-
- Downloads
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.
Loading
Please register or sign in to comment