|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55797 Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
Submitted: 2011-09-27 10:21 UTC Modified: 2011-09-27 10:22 UTC
From: Assigned: cataphract (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3.8 OS: Linux/gcc
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2011-09-27 10:21 UTC]
SdnToGregorian has an integer overflow error.

This has already been fixed; this report is for reference.

See also bug #53574.

Test script:
php -r 'print_r(cal_from_jd(882858030, CAL_GREGORIAN));

php -r 'print_r(cal_from_jd(9223372036854743639, CAL_GREGORIAN));'

Expected result:
No segfault

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-27 10:22 UTC]
-Summary: Integer overflow leads to segfault in SdnToGregorian (in optimized builds) +Summary: Integer overflow in SdnToGregorian leads to segfault (in optimized builds) -Status: Open +Status: Closed -Assigned To: +Assigned To: cataphract
 [2011-09-27 10:57 UTC]
Automatic comment from SVN on behalf of cataphract
Log: - Added tests and NEWS for r306475; see bug #55797.
- Removed now redundant previous overflow check, which relied on
  undefined behavior (wraparound) and was ignored in optimized builds.
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Sep 21 12:01:25 2018 UTC