mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
mindtct: Check for multiplication overflow in allocate_contour()
Assert if any of the multiplications, which are then used to allocate memory, would overflow. Closes: #97
This commit is contained in:
@@ -107,6 +107,8 @@ int allocate_contour(int **ocontour_x, int **ocontour_y,
|
|||||||
{
|
{
|
||||||
int *contour_x, *contour_y, *contour_ex, *contour_ey;
|
int *contour_x, *contour_y, *contour_ex, *contour_ey;
|
||||||
|
|
||||||
|
ASSERT_SIZE_MUL(ncontour, sizeof(int));
|
||||||
|
|
||||||
/* Allocate contour's x-coord list. */
|
/* Allocate contour's x-coord list. */
|
||||||
contour_x = (int *)malloc(ncontour*sizeof(int));
|
contour_x = (int *)malloc(ncontour*sizeof(int));
|
||||||
/* If allocation error... */
|
/* If allocation error... */
|
||||||
|
|||||||
Reference in New Issue
Block a user