regcomp fails with custom malloc

Bug #998256 reported by Robert Vollmert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

regcomp fails to compile the regular expression "^ " with memory error if malloc(0) returns NULL. That's valid malloc behavior, compare the man page malloc(3).

I had a little trouble debugging, but I believe the problem lies with posix/regex_internal.c:re_node_set_alloc being called with size == 0, and then treating the zero return value as an error.

I'm attaching a test program that should exhibit the bug.

ETA: I've tested this with libc6_2.15-0ubuntu10_amd64 under VMWare.

Revision history for this message
Robert Vollmert (anq) wrote :
description: updated
Robert Vollmert (anq)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.