From 059e774db013a8fc31cf2dce0e4d051580bf9d30 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 1 Apr 2015 00:41:46 +0300 Subject: [PATCH] Fixed bug #68740 (NULL Pointer Dereference) (cherry picked from commit 124fb22a13fafa3648e4e15b4f207c7096d8155e) --- ext/ereg/regex/regcomp.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.40.0