Bug 222564 - regcomp mallocs 0 byte
regcomp mallocs 0 byte
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-14 09:55 EST by Olivier Baudron
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-15 03:10:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Olivier Baudron 2007-01-14 09:55:25 EST
/* --- 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@perens.com>

ElectricFence Aborting: Allocating 0 bytes, probably a bug.
Illegal instruction
Comment 1 Jakub Jelinek 2007-01-15 03:10:40 EST
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.