aboutsummaryrefslogtreecommitdiff
path: root/src/std/hash_map.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-11 17:41:33 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-11 17:41:33 +0100
commit6cad09ec9c801e90d41f53ebcd673ef89050cc86 (patch)
treea57b30c824c663ed7730a6df6f2478a4a5b500e8 /src/std/hash_map.c
parent8d1532abb6f7441e00ffbc7ed4d0231e5023e19a (diff)
Check if file to read is really a fileHEADmaster
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r--src/std/hash_map.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/std/hash_map.c b/src/std/hash_map.c
index b4bd4c1..4bf55c6 100644
--- a/src/std/hash_map.c
+++ b/src/std/hash_map.c
@@ -224,6 +224,9 @@ bool hash_map_get_ref(HashMap *self, BufferView key, void **value) {
HashMapBucketNode *bucket_node;
bucket_size = buffer_get_size(&self->buckets, HashMapBucket);
+ if(bucket_size == 0)
+ return bool_false;
+
hash = self->hash_func((const u8*)key.data, key.size);
bucket_index = hash % bucket_size;