]> granicus.if.org Git - curl/commitdiff
nss: check return values of NSS functions
authorKamil Dudka <kdudka@redhat.com>
Fri, 18 Sep 2015 15:07:22 +0000 (17:07 +0200)
committerKamil Dudka <kdudka@redhat.com>
Fri, 18 Sep 2015 15:07:22 +0000 (17:07 +0200)
lib/vtls/nss.c

index c66c60b5617b4bfd720de2de1ef36380de3b4cc4..048273cf2c41b6960a24a11fae8e092d58b144f6 100644 (file)
@@ -1798,9 +1798,13 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex)
 
 
   /* Force handshake on next I/O */
-  SSL_ResetHandshake(connssl->handle, /* asServer */ PR_FALSE);
+  if(SSL_ResetHandshake(connssl->handle, /* asServer */ PR_FALSE)
+      != SECSuccess)
+    goto error;
 
-  SSL_SetURL(connssl->handle, conn->host.name);
+  /* propagate hostname to the TLS layer */
+  if(SSL_SetURL(connssl->handle, conn->host.name) != SECSuccess)
+    goto error;
 
   return CURLE_OK;