aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls/vtls.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-03-25 08:32:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-03-25 08:32:12 +0100
commit4e299192ed3310b387d0c95d0d0d4d145991aef7 (patch)
tree9ab4cbe6decd9971ab46c2dd2b7b2c982d4e1d96 /lib/vtls/vtls.c
parente35f2e61ecf18153c9a0b152c1f1a8b3d9475cf3 (diff)
Curl_ssl_md5sum: return CURLcode
... since the funciton can fail on OOM. Check this return code. Coverity CID 1291705.
Diffstat (limited to 'lib/vtls/vtls.c')
-rw-r--r--lib/vtls/vtls.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index 6973de42a..12427c17c 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -828,10 +828,10 @@ CURLcode Curl_pin_peer_pubkey(const char *pinnedpubkey,
}
#ifndef CURL_DISABLE_CRYPTO_AUTH
-void Curl_ssl_md5sum(unsigned char *tmp, /* input */
- size_t tmplen,
- unsigned char *md5sum, /* output */
- size_t md5len)
+CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */
+ size_t tmplen,
+ unsigned char *md5sum, /* output */
+ size_t md5len)
{
#ifdef curlssl_md5sum
curlssl_md5sum(tmp, tmplen, md5sum, md5len);
@@ -841,9 +841,12 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */
(void) md5len;
MD5pw = Curl_MD5_init(Curl_DIGEST_MD5);
+ if(!MD5pw)
+ return CURLE_OUT_OF_MEMORY;
Curl_MD5_update(MD5pw, tmp, curlx_uztoui(tmplen));
Curl_MD5_final(MD5pw, md5sum);
#endif
+ return CURLE_OK;
}
#endif