Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bbj17 at gmx.de <bbj17@gmx.de>
To: buildroot@busybox.net
Subject: [Buildroot] fix for package/config/util.c
Date: Wed, 30 Mar 2011 17:52:37 +0200	[thread overview]
Message-ID: <20110330155237.111340@gmx.net> (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.

--- package/config/util.c       2011-03-30 17:42:26.911184273 +0200
+++ package/config/util.c.old   2011-03-30 17:37:08.016057639 +0200
@@ -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
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

             reply	other threads:[~2011-03-30 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 15:52 bbj17 at gmx.de [this message]
2011-03-30 18:53 ` [Buildroot] fix for package/config/util.c Peter Korsgaard
  -- strict thread matches above, loose matches on Subject: below --
2011-03-30 16:08 bbj17 at gmx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110330155237.111340@gmx.net \
    --to=bbj17@gmx.de \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox