diff options
-rw-r--r-- | lib/hash-checksum.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/hash-checksum.c b/lib/hash-checksum.c index 8f2a42f9a0..68c290d64d 100644 --- a/lib/hash-checksum.c +++ b/lib/hash-checksum.c @@ -23,8 +23,10 @@ int hash_calculate(const char *name, struct hash_algo *algo; int ret = 0; void *ctx; - uint32_t i; - i = 0; + int i; + + if (region_count < 1) + return -EINVAL; ret = hash_progressive_lookup_algo(name, &algo); if (ret) |