aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_hasher_from_string.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libhashsum_init_hasher_from_string.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libhashsum_init_hasher_from_string.c b/libhashsum_init_hasher_from_string.c
index ffd23eb..e7a26d0 100644
--- a/libhashsum_init_hasher_from_string.c
+++ b/libhashsum_init_hasher_from_string.c
@@ -256,7 +256,10 @@ next:
if (*p++ != ']' || *p)
goto einval;
- r = initfunc(this, n, salti ? salt : NULL, pepperi ? pepper : NULL, key, keyi);
+ if (keyi > SIZE_MAX / 8U)
+ goto einval;
+
+ r = initfunc(this, n, salti ? salt : NULL, pepperi ? pepper : NULL, key, keyi * 8U);
free(key);
return r;