Fix error where we don't check for hash_type < 0
authorJonathan Dieter <jdieter@gmail.com>
Wed, 6 Jun 2018 10:23:04 +0000 (13:23 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Wed, 6 Jun 2018 10:23:04 +0000 (13:23 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/hash/hash.c

index 29f5560801e6b070be12db0151510388463d4d3c..de9277fa2949d51bbc60a72d4cc01ed90dcdb5f9 100644 (file)
@@ -409,7 +409,7 @@ int PUBLIC zck_validate_data_checksum(zckCtx *zck) {
 }
 
 const char PUBLIC *zck_hash_name_from_type(int hash_type) {
-    if(hash_type > 1) {
+    if(hash_type > 1 || hash_type < 0) {
         snprintf(unknown+8, 21, "%i)", hash_type);
         return unknown;
     }