mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
mindtct: Check for multiplication overflow in gen_high_curve_map()
Assert if any of the multiplications, which are then used to allocate memory, would overflow. Closes: #101
This commit is contained in:
@@ -898,9 +898,11 @@ int gen_high_curve_map(int **ohcmap, int *direction_map,
|
|||||||
int bx, by;
|
int bx, by;
|
||||||
int nvalid, cmeasure, vmeasure;
|
int nvalid, cmeasure, vmeasure;
|
||||||
|
|
||||||
|
ASSERT_INT_MUL(mw, mh);
|
||||||
mapsize = mw*mh;
|
mapsize = mw*mh;
|
||||||
|
|
||||||
/* Allocate High Curvature Map. */
|
/* Allocate High Curvature Map. */
|
||||||
|
ASSERT_SIZE_MUL(mapsize, sizeof(int));
|
||||||
high_curve_map = (int *)malloc(mapsize * sizeof(int));
|
high_curve_map = (int *)malloc(mapsize * sizeof(int));
|
||||||
if(high_curve_map == (int *)NULL){
|
if(high_curve_map == (int *)NULL){
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|||||||
Reference in New Issue
Block a user