diff mbox

[1/1] kconfig: sym_expand_string_value: allow for string termination when reallocing

Message ID 1288645304-2794-2-git-send-email-apw@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Whitcroft Nov. 1, 2010, 9:01 p.m. UTC
None
diff mbox

Patch

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index c0efe10..af6e9f3 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -875,7 +875,7 @@  const char *sym_expand_string_value(const char *in)
 			symval = sym_get_string_value(sym);
 		}
 
-		newlen = strlen(res) + strlen(symval) + strlen(src);
+		newlen = strlen(res) + strlen(symval) + strlen(src) + 1;
 		if (newlen > reslen) {
 			reslen = newlen;
 			res = realloc(res, reslen);