From 9abc6791c7a93359eaef5f6570d7d4b12e5c9ab6 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 13 Dec 2018 15:27:12 +0100 Subject: [PATCH] mindtct: Check for multiplication overflow in gen_initial_maps() Assert if any of the multiplications, which are then used to allocate memory, would overflow. Closes: #99 --- 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 d3a0b44..12c716f 100644 --- a/libfprint/nbis/mindtct/maps.c +++ b/libfprint/nbis/mindtct/maps.c @@ -272,6 +272,7 @@ int gen_initial_maps(int **odmap, int **olcmap, int **olfmap, print2log("INITIAL MAP\n"); /* Compute total number of blocks in map */ + ASSERT_INT_MUL(mw, mh); bsize = mw * mh; /* Allocate Direction Map memory */