PHP 4.0 Bug #8498: Crash due to buffer overflow - suggested patch inside
| From: | johan at ekenberg dot se | Date: | Sun, 31 Dec 2000 12:35:22 +0000 |
| Subject: | PHP 4.0 Bug #8498: Crash due to buffer overflow - suggested patch inside | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42614@lists.php.net to get a copy of this message | ||
From: johan@ekenberg.se
Operating system: Linux 2.2.16
PHP version: 4.0.4
PHP Bug Type: Date/time related
Bug description: Crash due to buffer overflow - suggested patch inside
date("r") prints current time in rfc822 format = 31 characters.
In "ext/standard/datetime.c" (line 491) these 31 chars are copied into a buffer
(tmp_buff) that is only 16 chars long.
On my machine this has caused segmentation faults on various occations.
Suggested patch:
--- datetime.c Sun Dec 31 13:06:48 2000
+++ datetime_fixed.c Sun Dec 31 13:04:41 2000
@@ -214,7 +214,7 @@
time_t the_time;
struct tm *ta, tmbuf;
int i, size = 0, length, h, beat;
- char tmp_buff[16];
+ char tmp_buff[32];
switch(ZEND_NUM_ARGS()) {
case 1:
--
Edit Bug report at: http://bugs.php.net/?id=8498&edit=1