With specific configurations requesting help for certain menu lines caused menuconfig to crash. This was tracked down to a null pointer bug. Thanks to "Miles Lane" <miles.lane@gmail.com> for inital reporting and to Gabriel C <nix.or.die@googlemail.com> for the backtrace that helped me locating the bug.
Showing the changes to scripts (2 of 2 files). Show all
Unified · Split
| @@ -357,8 +357,9 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym) · 356 unmodified lines | ||
| 357 | 357 | bool hit; |
| 358 | 358 | struct property *prop; |
| 359 | 359 | |
| 360 | − str_printf(r, "Symbol: %s [=%s]\n", sym->name, | |
| 361 | − sym_get_string_value(sym)); | |
| 360 | + if (sym && sym->name) | |
| 361 | + str_printf(r, "Symbol: %s [=%s]\n", sym->name, | |
| 362 | + sym_get_string_value(sym)); | |
| 362 | 363 | for_all_prompts(sym, prop) |
| 363 | 364 | get_prompt_str(r, prop); |
| 364 | 365 | hit = false; |
| @@ -84,12 +84,15 @@ void str_free(struct gstr *gs) · 83 unmodified lines | ||
| 84 | 84 | /* Append to growable string */ |
| 85 | 85 | void str_append(struct gstr *gs, const char *s) |
| 86 | 86 | { |
| 87 | − size_t l = strlen(gs->s) + strlen(s) + 1; | |
| 88 | − if (l > gs->len) { | |
| 89 | − gs->s = realloc(gs->s, l); | |
| 90 | − gs->len = l; | |
| 87 | + size_t l; | |
| 88 | + if (s) { | |
| 89 | + l = strlen(gs->s) + strlen(s) + 1; | |
| 90 | + if (l > gs->len) { | |
| 91 | + gs->s = realloc(gs->s, l); | |
| 92 | + gs->len = l; | |
| 93 | + } | |
| 94 | + strcat(gs->s, s); | |
| 91 | 95 | } |
| 92 | − strcat(gs->s, s); | |
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | /* Append printf formatted string to growable string */ |