feat: md2_2 nullcheck updated

This commit is contained in:
finn 2022-07-20 12:16:01 +02:00
parent 558f509281
commit c28c2d16d0
1 changed files with 2 additions and 4 deletions

View File

@ -58,14 +58,12 @@ void md2_hash_2(size_t len, const uint8_t buf[len], uint8_t out[16]) {
uint8_t l = 0;
uint8_t* checksum = calloc(16, sizeof(uint8_t));
if (checksum == NULL) {
printf("Failure: calloc returns NULL");
return EXIT_FAILURE;
return;
}
uint8_t* data = malloc(16);
if (data == NULL) {
printf("Failure: malloc returns NULL");
return EXIT_FAILURE;
return;
}
size_t bytes_left_to_read = file_stat.st_size;
size_t bytes_left_to_process = 0;