Prevent NULL pointer dereference in parser__repair_error_callback
Because repair_reduction_count is unsigned, the default of '-1' is 0xffffffff
and will cause the loop to be entered if repair_reduction_count is NULL:
src/runtime/parser.c:691:11: warning: Dereference of null pointer
if (repair_reductions[j].params.symbol == repair->symbol) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
fdd8792ebc
commit
da099d0bbe
1 changed files with 1 additions and 1 deletions
|
|
@ -656,7 +656,7 @@ static StackIterateAction parser__repair_error_callback(
|
|||
StackIterateAction result = StackIterateNone;
|
||||
|
||||
uint32_t last_repair_count = -1;
|
||||
uint32_t repair_reduction_count = -1;
|
||||
uint32_t repair_reduction_count = 0;
|
||||
const TSParseAction *repair_reductions = NULL;
|
||||
|
||||
for (uint32_t i = 0; i < repairs->size; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue