|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8498 Crash due to buffer overflow - suggested patch inside
Submitted: 2000-12-31 07:35 UTC Modified: 2001-01-02 15:27 UTC
From: johan at ekenberg dot se Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.4 OS: Linux 2.2.16
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: johan at ekenberg dot se
New email:
PHP Version: OS:


 [2000-12-31 07:35 UTC] johan at ekenberg dot se
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:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-02 15:27 UTC]
Fixed - thanks
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 21:01:29 2024 UTC