This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #16453] Don't use alloca in addgetnetgrentX
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Mike Frysinger <vapier at gentoo dot org>, GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Wed, 15 Jan 2014 18:35:54 +0100
- Subject: Re: [PATCH][BZ #16453] Don't use alloca in addgetnetgrentX
- Authentication-results: sourceware.org; auth=none
- References: <20140115113452 dot GJ1618 at spoyarek dot pnq dot redhat dot com> <201401151027 dot 05364 dot vapier at gentoo dot org> <CAAHN_R37RXXxZBOifs8R0-SLf7Xn7ibUuV5otWXzvTOV0nnMxA at mail dot gmail dot com> <52D6AD12 dot 5060506 at redhat dot com>
On Wed, Jan 15, 2014 at 10:45:22AM -0500, Carlos O'Donell wrote:
> On 01/15/2014 10:32 AM, Siddhesh Poyarekar wrote:
> > On 15 January 2014 20:57, Mike Frysinger <vapier@gentoo.org> wrote:
> >> On Wednesday 15 January 2014 06:34:52 Siddhesh Poyarekar wrote:
> >>> The bug report has a reproducer and I verified that the reproducer is
> >>> fixed with this patch. OK to commit?
> >>
> >> is there no way for us to set up local paths for networking files specifically
> >> for testing purposes ? seems like a pretty big hole in our testing abilities.
> >>
> >
> > The paths are hardcoded, which is why this is difficult and because of
> > that, nscd testing is essentially a noop. The chroot-based testing
> > framework that Ryan is working on will help this quite a bit.
> >
> >>> + buflen = MAX (2 * buflen,
> >>> + buflen + 2 * needed);
> >>> + char *newbuf = xrealloc (buffer, buflen);
> >>> + buffer = newbuf;
> >>
If we are at simplyfing buflen could be written as
buflen = buflen + MAX (buflen, 2 * needed)
to fit a line.