From a1e69a0e9db59ec8b25010066ec279f1723c87e8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 13 Dec 2018 15:38:46 +0100 Subject: [PATCH] mindtct: Check for multiplication overflow in morph_TF_map() Assert if any of the multiplications, which are then used to allocate memory and run a loop, would overflow. Closes: #92 --- libfprint/nbis/mindtct/maps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libfprint/nbis/mindtct/maps.c b/libfprint/nbis/mindtct/maps.c index 239005f..ac3b82d 100644 --- a/libfprint/nbis/mindtct/maps.c +++ b/libfprint/nbis/mindtct/maps.c @@ -677,6 +677,7 @@ int morph_TF_map(int *tfmap, const int mw, const int mh, int *mptr; int i; + ASSERT_INT_MUL(mw, mh); /* Convert TRUE/FALSE map into a binary byte image. */ cimage = (unsigned char *)malloc(mw*mh);