Bug 1213416 - php: NULL pointer dereference at ext/ereg/regex/regcomp.c
Summary: php: NULL pointer dereference at ext/ereg/regex/regcomp.c
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1213456
Blocks: 1213462
TreeView+ depends on / blocked
 
Reported: 2015-04-20 13:59 UTC by Vasyl Kaigorodov
Modified: 2019-09-29 13:31 UTC (History)
16 users (show)

Fixed In Version: php 5.4.40, php 5.5.24, php 5.6.8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-28 20:45:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Vasyl Kaigorodov 2015-04-20 13:59:02 UTC
PHP versions 5.4.40, 5.5.24 and 5.6.8 provide a fix for NULL pointer dereference leading to an application crash in ext/ereg/regex/regcomp.c.

From upstream bug:
"""
An explicit null deference happens in /ext/ereg/regex/regcomp.c:

  140        g->setbits = NULL;

then this is called:

  167        categorize(p, g);

which does this:

  1326                if (cats[c] == 0 && isinsets(g, c)) {

And then the isinsets function does this:

  1279        for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
  1280                if (col[uc] != 0)
  1281                        return(1);

which will cause a crash.
"""

Upstream fix:
http://git.php.net/?p=php-src.git;a=commitdiff;h=124fb22a13fafa3648e4e15b4f207c7096d8155e

Upstream bug:
https://bugs.php.net/bug.php?id=68740

Comment 1 Vasyl Kaigorodov 2015-04-20 15:25:04 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1213456]

Comment 2 Fedora Update System 2015-04-22 22:51:54 UTC
php-5.6.8-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2015-04-23 16:11:01 UTC
php-5.6.8-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2015-04-27 08:39:32 UTC
php-5.5.24-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Tomas Hoger 2015-05-28 20:45:51 UTC
This NULL dereference does not seem practically reachable as I noted in upstream bug:

https://bugs.php.net/bug.php?id=68740#1432845447

g->setbits is allocated before it can be dereferenced in isinsets().


Note You need to log in before you can comment on or make changes to this bug.