php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38721 date_parse() invalid read
Submitted: 2006-09-05 11:38 UTC Modified: 2006-09-08 20:22 UTC
From: tony2001@php.net Assigned: derick
Status: Closed Package: Date/time related
PHP Version: 5CVS-2006-09-05 (CVS) OS: Linux
Private report: No CVE-ID:
 [2006-09-05 11:38 UTC] tony2001@php.net
Description:
------------
valgrind reports an invalid read in date_parse().


Reproduce code:
---------------
<?php
date_parse("");
?>

Expected result:
----------------
.

Actual result:
--------------
==6705== Invalid read of size 1
==6705==    at 0x80EBDF9: timelib_strtotime (parse_date.re:1528)
==6705==    by 0x80C90CD: zif_date_parse (php_date.c:1694)
==6705==    by 0x831A56D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:200)
==6705==    by 0x831D460: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1657)
==6705==    by 0x831A180: execute (zend_vm_execute.h:92)
==6705==    by 0x82F1312: zend_eval_string (zend_execute_API.c:1130)
==6705==    by 0x82F1472: zend_eval_string_ex (zend_execute_API.c:1164)
==6705==    by 0x836184B: main (php_cli.c:1141)
==6705==  Address 0x49BCD27 is 1 bytes before a block of size 1 alloc'd
==6705==    at 0x401C4CE: malloc (vg_replace_malloc.c:149)
==6705==    by 0x82E30BA: _emalloc (zend_alloc.c:1628)
==6705==    by 0x82E3454: _estrndup (zend_alloc.c:1752)
==6705==    by 0x82FAD23: _zval_copy_ctor_func (zend_variables.c:120)
==6705==    by 0x835DE0C: _zval_copy_ctor (zend_variables.h:45)
==6705==    by 0x831D830: ZEND_SEND_VAL_SPEC_CONST_HANDLER (zend_vm_execute.h:1786)
==6705==    by 0x831A180: execute (zend_vm_execute.h:92)
==6705==    by 0x82F1312: zend_eval_string (zend_execute_API.c:1130)
==6705==    by 0x82F1472: zend_eval_string_ex (zend_execute_API.c:1164)
==6705==    by 0x836184B: main (php_cli.c:1141)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-08 20:22 UTC] tony2001@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 21:01:55 2014 UTC