comparison libtomcrypt/src/hashes/helper/hash_file.c @ 1733:d529a52b2f7c coverity coverity

merge coverity from main
author Matt Johnston <matt@ucc.asn.au>
date Fri, 26 Jun 2020 21:07:34 +0800
parents 1ff2a1034c52
children
comparison
equal deleted inserted replaced
1643:b59623a64678 1733:d529a52b2f7c
7 * guarantee it works. 7 * guarantee it works.
8 */ 8 */
9 #include "tomcrypt.h" 9 #include "tomcrypt.h"
10 10
11 #ifndef LTC_NO_FILE 11 #ifndef LTC_NO_FILE
12 /** 12 /**
13 @file hash_file.c 13 @file hash_file.c
14 Hash a file, Tom St Denis 14 Hash a file, Tom St Denis
15 */ 15 */
16 16
17 /** 17 /**
32 if ((err = hash_is_valid(hash)) != CRYPT_OK) { 32 if ((err = hash_is_valid(hash)) != CRYPT_OK) {
33 return err; 33 return err;
34 } 34 }
35 35
36 in = fopen(fname, "rb"); 36 in = fopen(fname, "rb");
37 if (in == NULL) { 37 if (in == NULL) {
38 return CRYPT_FILE_NOTFOUND; 38 return CRYPT_FILE_NOTFOUND;
39 } 39 }
40 40
41 err = hash_filehandle(hash, in, out, outlen); 41 err = hash_filehandle(hash, in, out, outlen);
42 if (fclose(in) != 0) { 42 if (fclose(in) != 0) {