This is the mail archive of the glibc-bugs@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]

[Bug math/16961] New: nan function incorrect handling of bad sequences


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.


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