This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] tst-fmon/tst-numeric: switch malloc to static stack space [BZ #19671]


* Mike Frysinger:

>> 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).
>
> these two tests are both badly written.  i've changed it to sizeof.

Thanks.  It's also annoying that the file is named tst-fmon, and not
tst-strfmon, which is why I missed it when I contributed
stdlib/tst-strfmon_l.c (it also did not occur to me to look at the
localedata subdirectory).  I wonder if we can add an internal
consistency check to tst-fmon and thus get rid of tst-strfmon_l.
(Obviously, this is a separate change.)

I wonder if the malloc allocation was done so that it is possible to
detect overflows in the implementation because that's easier for heap
overflows than for stack overflows.  It's the reason why I use malloc
in some tests.

In this case, the buffer length is not even close to what is actually
used by the output, so it's not a valid concern, and the removal of
malloc is appropriate.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]