Repository navigation
Commit 4afbe3b
committed
if-options: fix NULL dereference on missing variable name
strskipwhite() returns NULL when the remainder of a define/define6/
definend line is empty or whitespace-only (e.g. a trailing escaped
space protected from the config trim). parse_option() then called
strcasecmp(NULL, "reserved") and crashed.
Treat a NULL variable name the same as an absent one: error out for
types that require a name and accept np == NULL for OT_OPTION.
Reproducer: a config line 'define 119 string=x\\ ' (escaped trailing
space) segfaults at strcasecmp in parse_option (if-options.c:2120).
Fixes #731.1 parent 42ca579 commit 4afbe3b
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2117 | 2117 | | |
2118 | 2118 | | |
2119 | 2119 | | |
2120 | | - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
2121 | 2127 | | |
2122 | 2128 | | |
2123 | 2129 | | |
| |||
0 commit comments