From: Alessandro Ghedini Date: Fri, 2 Oct 2015 13:16:08 +0000 (+0200) Subject: Do not treat 0 return value from BIO_get_fd() as error X-Git-Tag: OpenSSL_1_0_1q~35 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=6a3dd58678b3dcd2bb40d4b0d9965c786d10342a Do not treat 0 return value from BIO_get_fd() as error 0 is a valid file descriptor. RT#4068 Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (cherry picked from commit 4428c7dba8f6f407d915c1226f4e0f673e8be241) --- diff --git a/apps/ocsp.c b/apps/ocsp.c index 572f0643e1..9fd9568825 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1220,8 +1220,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path, 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; }