This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/16961] New: nan function incorrect handling of bad sequences
- From: "jsm28 at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 19 May 2014 15:19:25 +0000
- Subject: [Bug math/16961] New: nan function incorrect handling of bad sequences
- Auto-submitted: auto-generated
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.