From cadf099e01b155a56a2f6ec856ddcb06d3c9552a Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Fri, 2 Dec 2022 14:11:53 +0100 Subject: [PATCH] eina hash: imporved safety Change-Id: I49a9d37974c49e5825534bc863e804b4037a2e53 --- src/lib/eina/eina_hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/eina/eina_hash.c b/src/lib/eina/eina_hash.c index d313e57..222e6cb 100644 --- a/src/lib/eina/eina_hash.c +++ b/src/lib/eina/eina_hash.c @@ -545,6 +545,8 @@ static int _eina_int32_key_cmp(const uint32_t *key1, EINA_UNUSED int key1_length, const uint32_t *key2, EINA_UNUSED int key2_length) { + EINA_SAFETY_ON_NULL_RETURN_VAL(key1, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(key2, -1); if (*key1 == *key2) return 0; if (*key1 > *key2) return 1; return -1; @@ -560,6 +562,8 @@ static int _eina_int64_key_cmp(const uint64_t *key1, EINA_UNUSED int key1_length, const uint64_t *key2, EINA_UNUSED int key2_length) { + EINA_SAFETY_ON_NULL_RETURN_VAL(key1, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(key2, -1); if (*key1 == *key2) return 0; if (*key1 > *key2) return 1; return -1; -- 2.7.4