From: Xinchen Hui Date: Tue, 31 Mar 2015 21:41:46 +0000 (+0300) Subject: Fixed bug #68740 (NULL Pointer Dereference) X-Git-Tag: php-5.6.8RC1~3^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=059e774db013a8fc31cf2dce0e4d051580bf9d30;p=php Fixed bug #68740 (NULL Pointer Dereference) (cherry picked from commit 124fb22a13fafa3648e4e15b4f207c7096d8155e) --- diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c index f4bfc1c167..c2223d7dbe 100644 --- a/ext/ereg/regex/regcomp.c +++ b/ext/ereg/regex/regcomp.c @@ -1284,6 +1284,10 @@ int c; register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; register unsigned uc = (unsigned char)c; + if (!g->setbits) { + return(0); + } + for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) if (col[uc] != 0) return(1);