summaryrefslogtreecommitdiff
path: root/package/config/util.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-03-30 20:51:48 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-03-30 20:51:48 +0200
commit3ef31b16c1ad68eaa8ceb34f38333e12b4ab8871 (patch)
treec1c50e9ada7c9f613a03d9d1b5c6684aa19c2419 /package/config/util.c
parent10f9ef7081d9d99c2910361c9089774ab03dc0f7 (diff)
package/config; br2_symbol_printer(): fix off-by-1 in string handling
Based on patch by bbj17@gmx.de. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/config/util.c')
-rw-r--r--package/config/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/package/config/util.c b/package/config/util.c
index 5fc36c7d2..f962cef31 100644
--- a/package/config/util.c
+++ b/package/config/util.c
@@ -35,12 +35,12 @@ static char* br2_symbol_printer(const char * const in)
char *ret;
if (len < 1)
return NULL;
- ret = malloc(len);
+ ret = malloc(len+1);
if (!ret) {
printf("Out of memory!");
exit(1);
}
- memset(ret, 0, len);
+ memset(ret, 0, len+1);
i = j = 0;
if (strncmp("BR2_", in, 4) == 0)
i += 4;
@@ -53,7 +53,7 @@ static char* br2_symbol_printer(const char * const in)
return ret;
}
-/* write dependencies of the infividual config-symbols */
+/* write dependencies of the individual config-symbols */
static int write_make_deps(const char *name)
{
char *str;