Commit 77923d6
committed
fix(cypher,store): prevent crashes from buffer overflow, OOM, and NULL stmts
- cypher: Add bounds check in lex_string_literal to prevent stack buffer
overflow on string literals >4096 bytes
- cypher: Add malloc/calloc NULL checks in parse_props, parse_rel_types,
parse_in_condition, and parse_case_expr to prevent OOM crashes
- store: Add sqlite3_prepare_v2 return code checks at 3 sites in
cbm_store_schema_info and collect_pkg_names to prevent NULL stmt
dereference on DB corruption1 parent 1d30971 commit 77923d6
3 files changed
+57
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
469 | 471 | | |
470 | 472 | | |
471 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
| |||
569 | 574 | | |
570 | 575 | | |
571 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
572 | 580 | | |
573 | 581 | | |
574 | 582 | | |
| |||
762 | 770 | | |
763 | 771 | | |
764 | 772 | | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
765 | 779 | | |
766 | 780 | | |
767 | 781 | | |
| |||
1061 | 1075 | | |
1062 | 1076 | | |
1063 | 1077 | | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1064 | 1081 | | |
1065 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1066 | 1087 | | |
1067 | 1088 | | |
1068 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2552 | 2552 | | |
2553 | 2553 | | |
2554 | 2554 | | |
2555 | | - | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2556 | 2558 | | |
2557 | 2559 | | |
2558 | 2560 | | |
| |||
2577 | 2579 | | |
2578 | 2580 | | |
2579 | 2581 | | |
2580 | | - | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2581 | 2585 | | |
2582 | 2586 | | |
2583 | 2587 | | |
| |||
3283 | 3287 | | |
3284 | 3288 | | |
3285 | 3289 | | |
3286 | | - | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
3287 | 3293 | | |
3288 | 3294 | | |
3289 | 3295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
| |||
2064 | 2090 | | |
2065 | 2091 | | |
2066 | 2092 | | |
| 2093 | + | |
2067 | 2094 | | |
2068 | 2095 | | |
2069 | 2096 | | |
| |||
0 commit comments