Explorar o código

fix scan-build warnings

Steffen Jaeckel %!s(int64=6) %!d(string=hai) anos
pai
achega
19e7f73948
Modificáronse 2 ficheiros con 4 adicións e 0 borrados
  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,