Closed iomartin closed 1 year ago
If the input is a large file and we allocate memory via malloc, we can cause an overflow when computing the comp_out_sz and decomp_out_sz (lines 4247 and 4250):
test_arg[i].comp_out_sz = test_arg[i].src_sz * 2; test_arg[i].decomp_out_sz = test_arg[i].src_sz * 5;
This would cause the associated mallocs to fail with ENOMEM.
Fix this by using size_t.
Also fix many other places where the variables from test_arg are copied into other variables.
Signed-off-by: Martin Oliveira martin.oliveira@eideticom.com
@iomartin , Very thanks for your patch, we will merge this patch in internal repo firstly and update to this repo when next release.
Update https://github.com/intel/QATzip/commit/753636457f944f6d3c30500070228d8f453bd6a6
If the input is a large file and we allocate memory via malloc, we can cause an overflow when computing the comp_out_sz and decomp_out_sz (lines 4247 and 4250):
This would cause the associated mallocs to fail with ENOMEM.
Fix this by using size_t.
Also fix many other places where the variables from test_arg are copied into other variables.
Signed-off-by: Martin Oliveira martin.oliveira@eideticom.com