crypto/rsa/rsa_pss.c: silence coverity warning
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Sun, 9 Sep 2018 14:33:12 +0000 (16:33 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 10 Sep 2018 10:03:50 +0000 (11:03 +0100)
Reported by Coverity Scan (CID 1439138)
[extended tests]

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7156)

crypto/rsa/rsa_pss.c

index 26d5f36..f7c575d 100644 (file)
@@ -244,7 +244,7 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
 
  err:
     EVP_MD_CTX_free(ctx);
-    OPENSSL_clear_free(salt, sLen);
+    OPENSSL_clear_free(salt, (size_t)sLen); /* salt != NULL implies sLen > 0 */
 
     return ret;