Skip to content

Commit 0996354

Browse files
committed
Fix compiler warning
``` pre_gen/tomcrypt_amalgam.c: In function ‘pkcs_1_oaep_encode’: pre_gen/tomcrypt_amalgam.c:64485:18: warning: ‘DB’ may be used uninitialized [-Wmaybe-uninitialized] 64485 | if ((err = hash_memory(lparam_hash_used, DB, 0, DB, &x)) != CRYPT_OK) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pre_gen/tomcrypt_amalgam.c:22613:5: note: by argument 2 of type ‘const unsigned char *’ to ‘hash_memory’ declared here 22613 | int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) | ^~~~~~~~~~~ ``` Use `out` instead of `DB`, since `out` is `LTC_ARGCHK`'ed. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 3a3cc23 commit 0996354

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pk/pkcs1/pkcs_1_oaep_encode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
8989
goto LBL_ERR;
9090
}
9191
} else {
92-
/* can't pass hash_memory a NULL so use DB with zero length */
93-
if ((err = hash_memory(lparam_hash_used, DB, 0, DB, &x)) != CRYPT_OK) {
92+
/* can't pass hash_memory a NULL so use `out` with zero length */
93+
if ((err = hash_memory(lparam_hash_used, out, 0, DB, &x)) != CRYPT_OK) {
9494
goto LBL_ERR;
9595
}
9696
}

0 commit comments

Comments
 (0)