Commit bb0e4c5
committed
Fix -Werror=maybe-uninitialized warning
GCC with AddressSanitizer reports that pathp in map_insert() may be
used uninitialized:
src/map.c:593:15: error: pathp may be used uninitialized
593 | for (pathp--; (uintptr_t) pathp >= (uintptr_t) path; pathp--)
While the program logic ensures pathp is always initialized through
rb_insert_unique() before use, static analysis cannot prove this due
to the pointer-to-pointer assignment pattern. Initialize to NULL to
satisfy the compiler and improve defensive programming.1 parent 9a33410 commit bb0e4c5
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| |||
0 commit comments