This is the mail archive of the
glibc-bugs-regex@sourceware.org
mailing list for the glibc project.
[Bug regex/1286] New: portability bugs in comparing size_t versus in regex_internal code
- From: "eggert at gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs-regex at sources dot redhat dot com
- Date: 1 Sep 2005 20:59:21 -0000
- Subject: [Bug regex/1286] New: portability bugs in comparing size_t versus in regex_internal code
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
The regex_internal code assigns the result of mbrtowc to an int
variable, but this has undefined behavior if (size_t) -1 cannot be
represented as an int.
Less importantly, the code compares X + 2 > 2 where X is of type
size_t, but this doesn't have the desired behavior in the (admittedly
very unlikely) case where size_t is narrower than int, since in that
case the comparison is signed rather than unsigned.
I'll attach a patch.
--
Summary: portability bugs in comparing size_t versus in
regex_internal code
Product: glibc
Version: 2.3.5
Status: NEW
Severity: normal
Priority: P2
Component: regex
AssignedTo: gotom at debian dot or dot jp
ReportedBy: eggert at gnu dot org
CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1286
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.