diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-10-12 01:05:09 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-10-12 01:05:09 +0000 |
commit | 8b8eb2cf88a2ce9bb27f589b290175201b30546d (patch) | |
tree | 39fc30938d8b11ab8a093abc271a809ae9c96698 /regex/regcomp.c | |
parent | 24b2efa342e516fae13064b2323f92e1a7a2a198 (diff) | |
download | php-git-8b8eb2cf88a2ce9bb27f589b290175201b30546d.tar.gz |
Fixed potential use of un-initialized var (detected by Coverity)
Diffstat (limited to 'regex/regcomp.c')
-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 */ |