summaryrefslogtreecommitdiff
path: root/regex/regcomp.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-10-12 01:05:09 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-10-12 01:05:09 +0000
commit8b8eb2cf88a2ce9bb27f589b290175201b30546d (patch)
tree39fc30938d8b11ab8a093abc271a809ae9c96698 /regex/regcomp.c
parent24b2efa342e516fae13064b2323f92e1a7a2a198 (diff)
downloadphp-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.c5
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 */