diff --git a/scripts/bump_fuzz_seed.py b/scripts/bump_fuzz_seed.py index 47d0c201..73f119b1 100644 --- a/scripts/bump_fuzz_seed.py +++ b/scripts/bump_fuzz_seed.py @@ -13,6 +13,7 @@ from __future__ import annotations import json from pathlib import Path +import shutil import sys import tempfile @@ -34,7 +35,7 @@ def main() -> None: with tempfile.NamedTemporaryFile("w", delete=False) as tmp: json.dump(data, tmp, indent=2) tmp.write("\n") - Path(tmp.name).replace(CFG) + shutil.move(tmp.name, CFG) # Fix: Invalid cross-device link print(f"✅ base_seed bumped: {old} → {new}") diff --git a/src/cor/lyt/buf.cpp b/src/cor/lyt/buf.cpp index e5c2110c..c1355488 100644 --- a/src/cor/lyt/buf.cpp +++ b/src/cor/lyt/buf.cpp @@ -127,6 +127,7 @@ void Buf::Swap(const Buf& a_buf) { void Buf::UnsafeAdvance(const n_t byte_c) { /**/ FLS_ASSERT_CORRECT_N(byte_c); + FLS_ASSERT_LE(m_off + byte_c, m_capacity); m_off += byte_c; } diff --git a/src/io/file.cpp b/src/io/file.cpp index c4410f8e..1a3e90c6 100644 --- a/src/io/file.cpp +++ b/src/io/file.cpp @@ -48,7 +48,8 @@ void File::Read(Buf& buf) { } auto file_size = fs::file_size(m_path); - FLS_ASSERT_LE(file_size, buf.Capacity()) + FLS_ASSERT_LE(file_size, buf.Capacity()); + buf.UnsafeAdvance(file_size); m_if_stream->read(reinterpret_cast(buf.mutable_data()), static_cast(file_size)); } @@ -61,6 +62,7 @@ void File::ReadRange(Buf& buf, const n_t offset, const n_t size) { [[maybe_unused]] auto file_size = fs::file_size(m_path); FLS_ASSERT_LE(offset + size, file_size); FLS_ASSERT_LE(size, buf.Capacity()); + buf.UnsafeAdvance(size); m_if_stream->seekg(static_cast(offset), std::ios::beg); m_if_stream->read(reinterpret_cast(buf.mutable_data()), static_cast(size)); diff --git a/test/src/quick_fuzz_tests/fuzz_config.json b/test/src/quick_fuzz_tests/fuzz_config.json index 889bc524..a9c7af5b 100644 --- a/test/src/quick_fuzz_tests/fuzz_config.json +++ b/test/src/quick_fuzz_tests/fuzz_config.json @@ -1,6 +1,6 @@ { "num_cases": 10, - "base_seed": 12, + "base_seed": 13, "delimiter": "|", "min_cols": 1, "max_cols": 2,