From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32726 invoked by alias); 1 Sep 2005 20:59:27 -0000 Mailing-List: contact glibc-bugs-regex-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sources.redhat.com Received: (qmail 32697 invoked by uid 48); 1 Sep 2005 20:59:21 -0000 Date: Thu, 01 Sep 2005 20:59:00 -0000 From: "eggert at gnu dot org" To: glibc-bugs-regex@sources.redhat.com Message-ID: <20050901205920.1286.eggert@gnu.org> Reply-To: sourceware-bugzilla@sources.redhat.com Subject: [Bug regex/1286] New: portability bugs in comparing size_t versus in regex_internal code X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg00008.txt.bz2 List-Id: 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.