This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] Fix another unbound alloca (BZ 13761)
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "Carlos O'Donell" <carlos_odonell at mentor dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 22 Jun 2012 15:14:46 -0700 (PDT)
- Subject: Re: [Patch] Fix another unbound alloca (BZ 13761)
- References: <4FE4D9C3.70703@redhat.com><4FE4DAE8.3060700@mentor.com><4FE4E44A.6090308@redhat.com>
You've added a "free (dataset);" call, but DATASET is never malloc'd.
If it's not alloca'd, it's from mempool_alloc.
I don't understand the nscd code well enough off hand to be sure it's
appropriate to use mempool_alloc for whatever the "(he != NULL)" case
means. If it is, then you don't need to free it because those pools are
GC'd--so you need less change than you did, the 'alloca_used' variable is
fine as it was. If it's not, then you need to use malloc for the new third
case (he != NULL && !__libc_use_alloca (...)), handle that error case
somehow, and do yet more bookkeeping to free it only when you used malloc.
Thanks,
Roland