Landing: 4426e08a4fd0

Project / Subsystem

gcc / libstdc++

Date

2026-07-17

Author

Tomasz Kamiński

Commit

4426e08a4fd0d35643d16a14c9e9b81488823a23

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
4426e08a4fd0d35643d16a14c9e9b81488823a23
source_type
github
headline
libstdc++: Prevent overflow in to_local conversion for timezone rules.
tldr
Fixes timezone conversion overflow that caused incorrect rule activation.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • timezone
  • bugfix
  • chrono
discussion_id_link
bugzilla_pr
date
2026-07-17T00:00:00.000Z

This change prevents an integer overflow in the to_local conversion function within libstdc++’s timezone database handling. Previously, adjusting the minimum or maximum system seconds for rules without activation could lead to overflow and undefined behavior, causing invalid rules to be considered active. The fix ensures that minimum and maximum values are constructed directly from time since epoch, resolving incorrect rule activation and ensuring timezone transitions are applied correctly, particularly for zones specified with UNTIL clauses.