Bug 222564 - regcomp mallocs 0 byte
Summary: regcomp mallocs 0 byte
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-14 14:55 UTC by Olivier Baudron
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-15 08:10:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Olivier Baudron 2007-01-14 14:55:25 UTC
/* --- Begin testcase.c --- */
#include <regex.h>
#include <sys/types.h>
int main (int argc, char **argv) {
    int err;
    regex_t preg;
    err = regcomp (&preg, "foo", REG_NOSUB);
    return 0;
}
/* --- End testcase.c --- */

$ gcc -Wall -o testcase testcase.c -lefence
$ ./testcase

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <bruce>

ElectricFence Aborting: Allocating 0 bytes, probably a bug.
Illegal instruction

Comment 1 Jakub Jelinek 2007-01-15 08:10:40 UTC
malloc (0) is well defined and having to special case this just to avoid
efence's complaints is wrong.
There is no bug.


Note You need to log in before you can comment on or make changes to this bug.