Landing: a068d1b7c9da

Project / Subsystem

gcc / libstdc++

Date

2026-01-07

Author

Tomasz Kamiński

Commit

a068d1b7c9da60a9b21efa4baf65f7325211be12

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
a068d1b7c9da60a9b21efa4baf65f7325211be12
source_type
github
headline
Libstdc++ Fixes Potential Null-Dereference in istreambuf_iterator
tldr
Libstdc++ now avoids a potential null-dereference warning in `istreambuf_iterator` by adjusting how the internal stream buffer pointer is handled.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • iterator
  • streambuf
  • null-dereference
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-01-07T00:00:00.000Z

Libstdc++ now clears the internal stream buffer pointer (_M_sbuf) in istreambuf_iterator::operator++() instead of _M_get(). This change addresses a false-positive null-dereference warning that could occur when incrementing an iterator that had previously reached the end of the stream. This also allows removing mutable from _M_sbuf, improving conformance with the C++11 standard regarding data races.