com php-src: Fixed bug #68740 (NULL Pointer Dereference): NEWS ext/ereg/regex/regcomp.c
| From: | Stanislav Malyshev | Date: | Mon, 06 Apr 2015 05:48:10 +0000 |
| Subject: | com php-src: Fixed bug #68740 (NULL Pointer Dereference): NEWS ext/ereg/regex/regcomp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86096@lists.php.net to get a copy of this message | ||
Commit: 9a404df382d041127eaa601b3113587df45d510d
Author: Xinchen Hui <laruence@php.net> Wed, 1 Apr 2015 00:41:46 +0300
Committer: Stanislav Malyshev <stas@php.net> Sun, 5 Apr 2015 22:48:10 -0700
Parents: 5ae20c624781bdd39ba14b2f856234c168f7ea38
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9a404df382d041127eaa601b3113587df45d510d
Log:
Fixed bug #68740 (NULL Pointer Dereference)
(cherry picked from commit 124fb22a13fafa3648e4e15b4f207c7096d8155e)
Bugs:
https://bugs.php.net/68740
Changed paths:
M NEWS
M ext/ereg/regex/regcomp.c
Diff:
diff --git a/NEWS b/NEWS
index f8f046c..0a83818 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015 PHP 5.4.40
+- Ereg:
+ . Fixed bug #68740 (NULL Pointer Dereference). (Laruence)
+
- GD:
. Fixed bug #68601 (buffer read overflow in gd_gif_in.c).. (Remi)
diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c
index f4bfc1c..c2223d7 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);