Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a67cb131 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Sam Ravnborg
Browse files

kconfig: fix segv fault in menuconfig



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.

Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 48874077
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym)
	bool hit;
	struct property *prop;

	if (sym && sym->name)
		str_printf(r, "Symbol: %s [=%s]\n", sym->name,
		                                    sym_get_string_value(sym));
	for_all_prompts(sym, prop)
+8 −5
Original line number Diff line number Diff line
@@ -84,13 +84,16 @@ void str_free(struct gstr *gs)
/* Append to growable string */
void str_append(struct gstr *gs, const char *s)
{
	size_t l = strlen(gs->s) + strlen(s) + 1;
	size_t l;
	if (s) {
		l = strlen(gs->s) + strlen(s) + 1;
		if (l > gs->len) {
			gs->s   = realloc(gs->s, l);
			gs->len = l;
		}
		strcat(gs->s, s);
	}
}

/* Append printf formatted string to growable string */
void str_printf(struct gstr *gs, const char *fmt, ...)