BIO_gets: fix the incomplete return check
authorPeiwei Hu <jlu.hpw@foxmail.com>
Sun, 14 Nov 2021 08:55:45 +0000 (16:55 +0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 22 Nov 2021 13:42:47 +0000 (14:42 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17028)

test/danetest.c

index 8af31aa34e4697b01ffff92e0dc35677d4856d3c..0ed460039d4819c96261bd3893f79ce3691fdf2f 100644 (file)
@@ -152,7 +152,7 @@ static char *read_to_eol(BIO *f)
     static char buf[4096];
     int n;
 
-    if (!BIO_gets(f, buf, sizeof(buf)))
+    if (BIO_gets(f, buf, sizeof(buf)) <= 0)
         return NULL;
 
     n = strlen(buf);