From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6147 invoked by alias); 3 Feb 2010 16:47:45 -0000 Received: (qmail 6020 invoked by uid 48); 3 Feb 2010 16:47:29 -0000 Date: Wed, 03 Feb 2010 16:47:00 -0000 From: "jim at meyering dot net" To: glibc-bugs-regex@sources.redhat.com Message-ID: <20100203164729.11244.jim@meyering.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug regex/11244] New: re_compiler_pattern fails to diagnose [b-a] as an invalid range X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-regex-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00000.txt.bz2 tested on rawhide, with glibc-2.11.90-10.x86_64: $ cat regex-check.c #include #include #include #include int main (int argc, char **argv) { char *regexp = (2 <= argc ? argv[1] : "a[b-a]"); struct re_pattern_buffer regex; /* Ensure that [b-a] is diagnosed as invalid. */ re_set_syntax (RE_SYNTAX_POSIX_EGREP); memset (®ex, 0, sizeof regex); const char *s = re_compile_pattern (regexp, strlen (regexp), ®ex); return s == NULL; } $ echo '#define _GNU_SOURCE 1' > config.h $ gcc -g -Wall -W -Wextra regex-check.c -I. $ ./a.out [Exit 1] It looks like the code intends to diagnose that condition with REG_ERANGE, but something is not working: start_collseq = lookup_collation_sequence_value (start_elem); end_collseq = lookup_collation_sequence_value (end_elem); /* Check start/end collation sequence values. */ if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0)) return REG_ECOLLATE; if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0)) return REG_ERANGE; -- Summary: re_compiler_pattern fails to diagnose [b-a] as an invalid range Product: glibc Version: 2.11 Status: NEW Severity: normal Priority: P2 Component: regex AssignedTo: drepper at redhat dot com ReportedBy: jim at meyering dot net CC: glibc-bugs-regex at sources dot redhat dot com,glibc- bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=11244 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.