public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/17916] New: fopen unbounded stack usage for ccs= modes
@ 2015-02-02 16:27 jsm28 at gcc dot gnu.org
  2015-02-06  9:26 ` [Bug stdio/17916] " fweimer at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-02-02 16:27 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 17916
           Summary: fopen unbounded stack usage for ccs= modes
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org

When the ",ccs=" notation is used with fopen to specify a character set
conversion, a copy of the character set name is made on the stack with no
bounds on the stack allocation: (from libio/fileops.c)

          char *endp = __strchrnul (cs + 5, ',');
          char ccs[endp - (cs + 5) + 3];

          *((char *) __mempcpy (ccs, cs + 5, endp - (cs + 5))) = '\0';

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


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

end of thread, other threads:[~2015-02-24 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 16:27 [Bug stdio/17916] New: fopen unbounded stack usage for ccs= modes jsm28 at gcc dot gnu.org
2015-02-06  9:26 ` [Bug stdio/17916] " fweimer at redhat dot com
2015-02-18 13:31 ` fweimer at redhat dot com
2015-02-22 20:10 ` ppluzhnikov at google dot com
2015-02-24 16:07 ` cvs-commit at gcc dot gnu.org
2015-02-24 16:10 ` ppluzhnikov at google 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).