From: Ilia Alshanetsky Date: Thu, 12 Oct 2006 01:05:25 +0000 (+0000) Subject: MFB: Fixed potential use of un-initialized var X-Git-Tag: RELEASE_1_0_0RC1~1301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59639f3de7b1dbf1513c4d65153f64792f850497;p=php MFB: Fixed potential use of un-initialized var --- diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c index ec034d4c4c..d72cc82940 100644 --- a/ext/ereg/regex/regcomp.c +++ b/ext/ereg/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 */ 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 */