Commit 1f3c12c9 authored by Guido van Rossum's avatar Guido van Rossum

Avoid core dump on symcomp("").

parent c8841c43
......@@ -398,6 +398,11 @@ symcomp(pattern, gdict)
object *npattern;
int require_escape = re_syntax & RE_NO_BK_PARENS ? 0 : 1;
if (oend == opat) {
INCREF(pattern);
return pattern;
}
npattern = newsizedstringobject((char*)NULL, getstringsize(pattern));
if (npattern == NULL)
return NULL;
......@@ -466,7 +471,6 @@ symcomp(pattern, gdict)
if (resizestring(&npattern, n - getstringvalue(npattern)) == 0)
return npattern;
else {
DECREF(npattern);
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment