Commit 4bb627d
committed
fix: avoid dereferencing past-the-end vector iterators in serialize.hpp
Two write() overloads in serialize.hpp used `&*buf.end()` to get a
pointer to the newly-appended region after resize(). Under
_GLIBCXX_DEBUG (enabled in asan-fast and debug presets since #22218),
dereferencing end() triggers a debug assertion abort.
Replace with `buf.data() + buf.size()` which achieves the same
pointer arithmetic without dereferencing any iterator.1 parent ed6069d commit 4bb627d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
0 commit comments