feat: md2_2 nullcheck updated

This commit is contained in:
finn 2022-07-20 12:16:01 +02:00
parent 558f509281
commit c28c2d16d0

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 l = 0;
uint8_t* checksum = calloc(16, sizeof(uint8_t)); uint8_t* checksum = calloc(16, sizeof(uint8_t));
if (checksum == NULL) { if (checksum == NULL) {
printf("Failure: calloc returns NULL"); return;
return EXIT_FAILURE;
} }
uint8_t* data = malloc(16); uint8_t* data = malloc(16);
if (data == NULL) { if (data == NULL) {
printf("Failure: malloc returns NULL"); return;
return EXIT_FAILURE;
} }
size_t bytes_left_to_read = file_stat.st_size; size_t bytes_left_to_read = file_stat.st_size;
size_t bytes_left_to_process = 0; size_t bytes_left_to_process = 0;