Skip to content

Fix GH-18422: int overflow in php_date_llabs#17

Closed
iliaal wants to merge 1 commit intomasterfrom
fix/gh-18422-date-llabs-overflow
Closed

Fix GH-18422: int overflow in php_date_llabs#17
iliaal wants to merge 1 commit intomasterfrom
fix/gh-18422-date-llabs-overflow

Conversation

@iliaal
Copy link
Copy Markdown
Owner

@iliaal iliaal commented Apr 4, 2026

php_date_llabs negates with -i, which is UB when i is LLONG_MIN. Cast to unsigned long long before negating and changed the return type to match. Updated Y/x/X format call sites from %lld to %llu.

Fixes php#18422

php_date_llabs negated its argument with -i, which is UB when i is
LLONG_MIN. Cast to unsigned long long before negating and changed the
return type to match. Updated Y/x/X format call sites from %lld to %llu.

Closes phpGH-18422
@iliaal iliaal force-pushed the fix/gh-18422-date-llabs-overflow branch from 5987cd3 to 8068a48 Compare April 4, 2026 14:17
@iliaal
Copy link
Copy Markdown
Owner Author

iliaal commented Apr 4, 2026

Submitted upstream: php#21638

@iliaal iliaal closed this Apr 4, 2026
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

Successfully merging this pull request may close these issues.

int overflow in Date extension

1 participant