diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-12-13 10:54:29 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-12-13 13:06:12 +0000 |
commit | 959a80a46dbc4d3ad1bf8560dfacb585ccd8cac4 (patch) | |
tree | f4c0105c598759280db6d283ec48ce39f761bb11 /libgo | |
parent | 233860f005ccd76c7604cf0eac18b9eda3d984f4 (diff) | |
download | gcc-959a80a46dbc4d3ad1bf8560dfacb585ccd8cac4.zip gcc-959a80a46dbc4d3ad1bf8560dfacb585ccd8cac4.tar.gz gcc-959a80a46dbc4d3ad1bf8560dfacb585ccd8cac4.tar.bz2 |
libstdc++: Fix uninitialized data in std::basic_spanbuf::seekoff
I noticed a -Wmaybe-uninitialized warning for this function, which turns
out to be correct. If the caller passes a valid std::ios_base::seekdir
value then there's no problem, but if they pass std::seekdir(999) then
we don't initialize the __base variable before adding it to __off.
Rather than initialize it to an arbitrary value, we should return an
error.
Also add [[unlikely]] attributes to the paths that return an error.
libstdc++-v3/ChangeLog:
* include/std/spanstream (basic_spanbuf::seekoff): Return an
error for invalid seekdir values.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions