This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] tst-fmon/tst-numeric: switch malloc to static stack space [BZ #19671]
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 23 Apr 2016 14:23:58 +0200
- Subject: Re: [PATCH] tst-fmon/tst-numeric: switch malloc to static stack space [BZ #19671]
- Authentication-results: sourceware.org; auth=none
- References: <1461359558-26367-1-git-send-email-vapier at gentoo dot org>
* Mike Frysinger:
> The current test code doesn't check the return value of malloc.
> This should rarely (if ever) cause a problem, but rather than add
> some return value checks, just statically allocate the buffer on
> the stack. This will never fail (or if it does, we've got much
> bigger problems that don't matter to the test).
This needs a ChangeLog entry.
> - char *s = malloc (201);
> + char s;
Please use a enum constant of 200, and also pass it to strfmon.
K think the current 200/201 choice is technically incorrect
(the maximum includes the terminating null byte).