make tpi hash parsing gracefully exit on empty input data

This commit is contained in:
Ryan Fleury
2024-03-13 15:10:39 -07:00
parent d3cdb97a4e
commit fbf4cce0e7
+1 -1
View File
@@ -310,7 +310,7 @@ pdb_tpi_hash_from_data(Arena *arena, PDB_Strtbl *strtbl, PDB_TpiParsed *tpi, Str
U32 stride = tpi->hash_key_size;
U32 bucket_count = tpi->hash_bucket_count;
if (1 <= stride && stride <= 8 && bucket_count > 0){
if (1 <= stride && stride <= 8 && bucket_count > 0 && data.str != 0){
// allocate buckets
PDB_TpiHashBlock **buckets = push_array(arena, PDB_TpiHashBlock*, bucket_count);