Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTimeHelper::ParseRFC2822DateString integer overflow on 32-bit PHP (getTimestamp() fails) #1913

Open
sgoranov opened this issue Feb 12, 2025 · 0 comments

Comments

@sgoranov
Copy link

sgoranov commented Feb 12, 2025

Description

On a 32-bit PHP version, getTimestamp() in DateTimeHelper::ParseRFC2822DateString() fails with:

PHP Fatal error: Uncaught Error: Epoch doesn't fit in a PHP integer in Messages.php:101

This happens because getTimestamp() returns an integer, which exceeds the 32-bit limit for large timestamps.

Steps to Reproduce

  1. Install SnappyMail on a 32-bit PHP system (e.g., Raspberry Pi).
  2. Attempt to parse an RFC 2822 date string with a large year (e.g., Thu, 10 Jun 2038 08:58:33 -0700).
  3. Observe the fatal error.

Expected Behavior

  • It should not crash on 32-bit PHP.
@sgoranov sgoranov changed the title ParseRFC2822DateString integer overflow on 32-bit PHP (getTimestamp() fails) DateTimeHelper::ParseRFC2822DateString integer overflow on 32-bit PHP (getTimestamp() fails) Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant