public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16961] New: nan function incorrect handling of bad sequences
@ 2014-05-19 15:19 jsm28 at gcc dot gnu.org
  2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-05-19 15:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

            Bug ID: 16961
           Summary: nan function incorrect handling of bad sequences
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org

The nan function does:

  if (tagp[0] != '\0')
    {
      char buf[6 + strlen (tagp)];
      sprintf (buf, "NAN(%s)", tagp);
      return strtod (buf, NULL);
    }

If the argument starts with an n-char-sequence, but is not one in its entirety,
the return value is determined by that n-char-sequence.  But according to ISO
C, "If tagp does not point to an n-char sequence or an empty string, the call
is equivalent to strtod("NAN", (char**) NULL).", so the initial characters
should have no effect on the return value.  The same applies to nanf and nanl.

(n-char-sequences are sequences of ASCII letters, digits and underscores.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-12 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
2014-05-19 15:41 ` jsm28 at gcc dot gnu.org
2014-05-19 15:47 ` schwab@linux-m68k.org
2014-05-19 15:57 ` jsm28 at gcc dot gnu.org
2014-05-19 16:03 ` schwab@linux-m68k.org
2014-06-12 19:18 ` fweimer at redhat dot com

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