diff options
Diffstat (limited to 'regex')
-rw-r--r-- | regex/regcomp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/regex/regcomp.c b/regex/regcomp.c index ec034d4c4c..d72cc82940 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -1553,6 +1553,11 @@ register struct re_guts *g; if (g->mlen == 0) /* there isn't one */ return; + if (!start) { + g->mlen = 0; + return; + } + /* turn it into a character string */ g->must = malloc((size_t)g->mlen + 1); if (g->must == NULL) { /* argh; just forget it */ |