1
0
mirror of https://git.disroot.org/80486DX2-66/polonium.git synced 2024-12-26 07:09:50 +05:30

corrupter.c: allocate correct amount of heap memory

This commit is contained in:
Intel A80486DX2-66 2024-11-24 12:14:42 +03:00
parent a83b9c3c32
commit 9e9ac7ce3c
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -132,8 +132,10 @@ Corrupter_Result corrupt_file(Corrupter_Param* param) {
rewind(file);
size_t file_size = end - start;
// allocate memory for the file content
byte* buffer = malloc(end);
byte* buffer = malloc(file_size * sizeof(byte));
if (buffer == NULL) {
PERROR_MACRO("malloc");
@ -156,7 +158,7 @@ Corrupter_Result corrupt_file(Corrupter_Param* param) {
}
// output data to result
result.file_size = end - start;
result.file_size = file_size;
// initialize the PRNG
mt_seed(param->seed);