#19649 [Com]: Nested [] in browscap.ini cause PHP to crash
| From: | ronstk at worldonline dot nl | Date: | Fri, 24 Jan 2003 15:04:41 +0000 |
| Subject: | #19649 [Com]: Nested [] in browscap.ini cause PHP to crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31142@lists.php.net to get a copy of this message | ||
ID: 19649
Comment by: ronstk@worldonline.nl
Reported By: mark@quarella.co.uk
Status: Closed
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 4.3.0-dev
Assigned To: zeev
New Comment:
From the browsecap.ini included v4.2.3.
[AE/2.1 (linux)]
browser=AE/2.1(Linux)
;browser="AE/2.1(Linux)"
version=2.1
gives me the error in dosbox:
PHP: Error parsing E:\Iservers\PHP\browscap\browscap.ini on line
8206.
The fault here are the '(' and ')'
This is.nt working with 4.3.x also
Previous Comments:
------------------------------------------------------------------------
[2002-10-14 13:23:44] iliaa@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-10-01 18:00:17] iliaa@php.net
verified & updated version.
The problem occurs because 'arg2' passed to php_browscap_parser_cb() is
NULL and there are no checks for it, which causes Z_STRLEN_P(arg2) to
core.
------------------------------------------------------------------------
[2002-09-28 10:58:17] mark@quarella.co.uk
An entry in browscap.ini similar to the following:
[Mozilla/4.76 (Macintosh;US;PPC) Opera 4.? [en]]
.. will cause Apache/PHP to fail to start (segmentation fault) due to
the nested [] symbols.
The following complete browscap.ini would be enough to reproduce this:
[Opera 4.0]
[Mozilla/4.76 (Macintosh;US;PPC) Opera 4.? [en]]
parent=Opera 4.0
platform=MacPPC
Interestingly, without a correctly formed entry on the first line PHP
reports a warning instead.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19649&edit=1