Skip to contentSkip to conversation

fix for package/config/util.c

Buildroot bbj17 at gmx.de 2 participants 2 messages Mar 30, 2011

lore
Share & tools
lore
#0 lore raw

I found a bug in package/config/util.c (package/config/patches/08-make-write-deps.patch).

Symbols not starting with BR2_ / PACKAGE_ / TARGET_ will result in memory corruption.

config/util.c.old 2011-03-30 17:37:08.016057639 +0200 renamed from config/util.c 2011-03-30 17:42:26.911184273 +0200 +2 -2
@@ -35,12 +35,12 @@
        char *ret;
        if (len < 1)
                return NULL;
-       ret = malloc(len+1);
+       ret = malloc(len);
        if (!ret) {
                printf("Out of memory!");
                exit(1);
        }
-       memset(ret, 0, len+1);
+       memset(ret, 0, len);
        i = j = 0;
        if (strncmp("BR2_", in, 4) == 0)
                i += 4;

Ben

Signature · 2 lines
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"bbj17" == bbj17 <[email protected]> writes:

bbj17> I found a bug in package/config/util.c
bbj17> (package/config/patches/08-make-write-deps.patch). Symbols not bbj17> starting with BR2_ / PACKAGE_ / TARGET_ will result in memory bbj17> corruption.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard