public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] tst-fmon/tst-numeric: switch malloc to static stack space [BZ #19671]
Date: Sat, 23 Apr 2016 20:05:00 -0000	[thread overview]
Message-ID: <878u04gkgd.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20160423182456.GM5369@vapier.lan> (Mike Frysinger's message of "Sat, 23 Apr 2016 14:24:56 -0400")

* 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.

      reply	other threads:[~2016-04-23 20:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 21:12 Mike Frysinger
2016-04-23 12:24 ` Florian Weimer
2016-04-23 18:25   ` Mike Frysinger
2016-04-23 20:05     ` Florian Weimer [this message]

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=878u04gkgd.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).