Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Paul Stravers
Fri, 18 Dec 1992 15:13
regex.c: uninitialized field causes SEGV
Author: Paul Stravers
Date: Fri, 18 Dec 1992 15:13
Date: Fri, 18 Dec 1992 15:13
36 lines
2146 bytes
2146 bytes
This reports a small bug and a fix for GNU regex.c version 0.11.
The POSIX function regcomp(preg, pattern, cflags) does not initialize the field
preg->allocated to 0 before calling regex_compile(). Dependent on the random
value of this field, this causes regex_compile() to abort with a SEGV. Here
is the patch:
------------------------------------------------------------------------------
**************
*** 4683,4690
= cflags & REG_EXTENDED ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
--- 4687,4695 -----
= cflags & REG_EXTENDED ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
+ preg->allocated = 0;
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
------------------------------------------------------------------------------
--
Delft University of Technology | email stravers@donau.et.tudelft.nl
Faculty of Electrical Engineering | fax +31 15 786190
Mekelweg 4 | ph. +31 15 786280
2628 CD Delft |
the Netherlands |
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads