Commit 7511415
authored
fix: replace UB end-iterator dereference in serialize.hpp (#22262)
## Summary
Two `write()` overloads in `serialize.hpp` used `&*buf.end()` to get a
pointer to newly appended space. Dereferencing `end()` is UB, now caught
by `_GLIBCXX_DEBUG` (enabled in asan-fast builds via #22218). This
caused `ChonkTests.Basic` to abort in CI.
## Fix
Replace `&*buf.end() - offset` with `buf.data() + buf.size() - offset`
(well-defined pointer arithmetic).
## Verification
- `ChonkTests.Basic` under asan-fast: PASSED
- Full `barretenberg/cpp/bootstrap.sh ci`: All 6148 tests passed
Detailed analysis:
https://gist.github.com/AztecBot/76c4c49c772843199db95099062ffeb3"
ClaudeBox log: https://claudebox.work/s/1aa27334b5d24bba?run=11 parent e7adaa6 commit 7511415
0 file changed
0 commit comments