public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16962] New: nan function unbounded stack allocation
@ 2014-05-19 15:21 jsm28 at gcc dot gnu.org
  2014-05-19 15:46 ` [Bug math/16962] " fweimer at redhat dot com
  2014-06-12 18:47 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-05-19 15:21 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16962
           Summary: nan function unbounded stack allocation
           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 (nanf, nanl likewise) does:

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

This is an unbounded stack allocation based on the length of the argument. 
Instead the relevant code from strtod should be refactored so that the right
NaN can be returned without needing to copy the string at all.  (See also bug
16961 for another issue with this code.)

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


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

* [Bug math/16962] nan function unbounded stack allocation
  2014-05-19 15:21 [Bug math/16962] New: nan function unbounded stack allocation jsm28 at gcc dot gnu.org
@ 2014-05-19 15:46 ` fweimer at redhat dot com
  2014-06-12 18:47 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-05-19 15:46 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

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


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

* [Bug math/16962] nan function unbounded stack allocation
  2014-05-19 15:21 [Bug math/16962] New: nan function unbounded stack allocation jsm28 at gcc dot gnu.org
  2014-05-19 15:46 ` [Bug math/16962] " fweimer at redhat dot com
@ 2014-06-12 18:47 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-12 18:47 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security+

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


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19 15:21 [Bug math/16962] New: nan function unbounded stack allocation jsm28 at gcc dot gnu.org
2014-05-19 15:46 ` [Bug math/16962] " fweimer at redhat dot com
2014-06-12 18:47 ` 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).