explicitly handle null terminator in abbrev parse

This commit is contained in:
Nikita Smith
2026-02-19 18:11:12 -08:00
parent a9d3757dbc
commit a6dd529dd5
+10 -1
View File
@@ -452,8 +452,17 @@ dw_read_abbrev_tag(String8 data, U64 offset, DW_Abbrev *out_abbrev)
U64 cursor = offset;
// read tag ID and kind
U64 id, kind;
U64 id = 0;
TryRead(str8_deserial_read_uleb128(data, cursor, &id), cursor, exit);
// is this null terminator?
if (id == 0) {
total_bytes_read = cursor - offset;
MemoryZeroStruct(out_abbrev);
goto exit;
}
U64 kind = 0;
TryRead(str8_deserial_read_uleb128(data, cursor, &kind), cursor, exit);
// read child flag