Do not treat 0 return value from BIO_get_fd() as error
authorAlessandro Ghedini <alessandro@ghedini.me>
Fri, 2 Oct 2015 13:16:08 +0000 (15:16 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 23 Oct 2015 18:38:06 +0000 (20:38 +0200)
0 is a valid file descriptor.

RT#4068

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 4428c7dba8f6f407d915c1226f4e0f673e8be241)

apps/ocsp.c

index 572f0643e13c7a4cb40aa0deee4e6597ae590d97..9fd95688251f143a5e39d3ca31c2134a09ae14e1 100644 (file)
@@ -1220,8 +1220,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
         return NULL;
     }
 
         return NULL;
     }
 
-    if (BIO_get_fd(cbio, &fd) <= 0) {
-        BIO_puts(err, "Can't get connection fd\n");
+    if (BIO_get_fd(cbio, &fd) < 0) {
+        BIO_puts(bio_err, "Can't get connection fd\n");
         goto err;
     }
 
         goto err;
     }