]> granicus.if.org Git - php/commitdiff
Fixed bug #68740 (NULL Pointer Dereference)
authorXinchen Hui <laruence@php.net>
Tue, 31 Mar 2015 21:41:46 +0000 (00:41 +0300)
committerLior Kaplan <kaplanlior@gmail.com>
Tue, 31 Mar 2015 22:24:26 +0000 (01:24 +0300)
(cherry picked from commit 124fb22a13fafa3648e4e15b4f207c7096d8155e)

ext/ereg/regex/regcomp.c

index f4bfc1c1679ffedfff020a7c1c73811075cb7710..c2223d7dbe05e48cd281179b45e97cf297dcba41 100644 (file)
@@ -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);