Landing: 5d419c69ce2e

Project / Subsystem

gcc / libstdc++

Date

2026-10-01

Author

Jonathan Wakely

Commit

5d419c69ce2e6b86d7da75f18736904885674219

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
—
commit_hash
5d419c69ce2e6b86d7da75f18736904885674219
source_type
github
headline
libstdc++: Fix stack corruption in std::bitset stream extraction
tldr
Fixes stack corruption in `std::bitset::operator>>` by replacing `__builtin_alloca` with a stack array.
author
Jonathan Wakely
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • libstdc++
  • • security
  • • bugfix
discussion_id_link
—
bugzilla_pr
—
date
2026-10-01T00:00:00.000Z

This commit resolves a stack corruption vulnerability in the stream extraction operator (operator>>) for std::bitset. The issue was caused by an incorrect argument to __builtin_alloca, which did not properly account for the size or alignment of wide characters. The fix replaces __builtin_alloca with a stack-allocated array, ensuring correct memory management and preventing stack corruption.