Browse Source

fix scan-build warnings

Steffen Jaeckel 6 years ago
parent
commit
19e7f73948
2 changed files with 4 additions and 0 deletions
  1. 3 0
      demos/gcm-file/gcm_file.c
  2. 1 0
      demos/gcm-file/gcm_filehandle.c

+ 3 - 0
demos/gcm-file/gcm_file.c

@@ -37,6 +37,7 @@
   @param out               The output file
   @param taglen            The MAC tag length
   @param direction         Encrypt or Decrypt mode (GCM_ENCRYPT or GCM_DECRYPT)
+  @param res               [out] Result of the operation, 1==valid, 0==invalid
   @return CRYPT_OK on success
  */
 int gcm_file(      int           cipher,
@@ -56,6 +57,8 @@ int gcm_file(      int           cipher,
     LTC_ARGCHK(out != NULL);
     LTC_ARGCHK(res != NULL);
 
+    *res = 0;
+
     f_in = fopen(in, "rb");
     if (f_in == NULL) {
        err = CRYPT_FILE_NOTFOUND;

+ 1 - 0
demos/gcm-file/gcm_filehandle.c

@@ -55,6 +55,7 @@
   @param out               The output file
   @param taglen            The MAC tag length
   @param direction         Encrypt or Decrypt mode (GCM_ENCRYPT or GCM_DECRYPT)
+  @param res               [out] Result of the operation, 1==valid, 0==invalid
   @return CRYPT_OK on success
  */
 int gcm_filehandle(      int           cipher,