summaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-10-12 01:05:25 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-10-12 01:05:25 +0000
commit59639f3de7b1dbf1513c4d65153f64792f850497 (patch)
tree5fa0a4fe6a295d00bd61ff080675d8e584a53973 /regex
parent6636616ae9385f7e41ccd420aa1cf78bba282d4a (diff)
downloadphp-git-59639f3de7b1dbf1513c4d65153f64792f850497.tar.gz
MFB: Fixed potential use of un-initialized var
Diffstat (limited to 'regex')
-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 */