]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/bio/bss_bio.c/bio_write: improve border check
authorPW Hu <jlu.hpw@foxmail.com>
Fri, 3 Sep 2021 09:50:40 +0000 (17:50 +0800)
committerTomas Mraz <tomas@openssl.org>
Tue, 7 Sep 2021 14:01:53 +0000 (16:01 +0200)
CLA:trivial

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16503)

crypto/bio/bss_bio.c

index 7fa8778cae10d476270d6f952118455d438f9859..92dd26230916d42def96bd874c63837cda543215 100644 (file)
@@ -273,7 +273,7 @@ static int bio_write(BIO *bio, const char *buf, int num_)
 
     BIO_clear_retry_flags(bio);
 
-    if (!bio->init || buf == NULL || num == 0)
+    if (!bio->init || buf == NULL || num_ <= 0)
         return 0;
 
     b = bio->ptr;