Commit 0372ae8b authored by Bastien Nocera's avatar Bastien Nocera

mindtct: Check for multiplication overflow in alloc_power_stats()

Assert if any of the multiplications, which are then used to allocate
memory, would overflow.

Closes: #91
parent a1e69a0e
Pipeline #12096 passed with stages
in 4 minutes and 1 second
......@@ -693,6 +693,9 @@ int alloc_power_stats(int **owis, double **opowmaxs, int **opowmax_dirs,
int *wis, *powmax_dirs;
double *powmaxs, *pownorms;
ASSERT_SIZE_MUL(nstats, sizeof(int));
ASSERT_SIZE_MUL(nstats, sizeof(double));
/* Allocate DFT wave index vector */
wis = (int *)malloc(nstats * sizeof(int));
if(wis == (int *)NULL){
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment