public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bhaak at gmx dot net" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug libc/17674] New: ctype functions with wrong return values and crashes Date: Wed, 03 Dec 2014 15:13:00 -0000 [thread overview] Message-ID: <bug-17674-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=17674 Bug ID: 17674 Summary: ctype functions with wrong return values and crashes Product: glibc Version: 2.20 Status: NEW Severity: normal Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: bhaak at gmx dot net CC: drepper.fsp at gmail dot com Created attachment 7992 --> https://sourceware.org/bugzilla/attachment.cgi?id=7992&action=edit C code demonstrating wrong return values and crash of isblank The ctype functions (probably all, I tested with isblank, isspace, and isalpha) return wrong results if they are called with int values bigger than UCHAR_MAX. Furthermore, for some big int values it crashes with a segmentation fault. The attached C file outputs all values from 0 to INT_MAX which return true from isblank. On a Gentoo machine it crashed with 151056, on an Ubuntu machine with 163152. I know that the ctype functions are technically in POSIX only defined for values representable as an unsigned char or the value of EOF but this is stupid nevertheless for a library function. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2014-12-03 15:13 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-03 15:13 bhaak at gmx dot net [this message] 2014-12-03 15:28 ` [Bug libc/17674] " schwab@linux-m68k.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-17674-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).