feat: md2_2 nullcheck updated
This commit is contained in:
parent
558f509281
commit
c28c2d16d0
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue