diff --git a/crypto/bio/bio.h b/crypto/bio/bio.h index 5d1654aaef..54bf622a3b 100644 --- a/crypto/bio/bio.h +++ b/crypto/bio/bio.h @@ -618,6 +618,7 @@ int BIO_printf(BIO *bio, ...); #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 #define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 +#define BIO_R_INVALID_ARGUMENT 125 #define BIO_R_INVALID_IP_ADDRESS 108 #define BIO_R_IN_USE 123 #define BIO_R_KEEPALIVE 109 diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c index e31bf32aa4..712d98a3a1 100644 --- a/crypto/bio/bio_err.c +++ b/crypto/bio/bio_err.c @@ -101,6 +101,7 @@ static ERR_STRING_DATA BIO_str_reasons[]= {BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET,"error setting nbio on accepted socket"}, {BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET,"error setting nbio on accept socket"}, {BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET ,"gethostbyname addr is not af inet"}, +{BIO_R_INVALID_ARGUMENT ,"invalid argument"}, {BIO_R_INVALID_IP_ADDRESS ,"invalid ip address"}, {BIO_R_IN_USE ,"in use"}, {BIO_R_KEEPALIVE ,"keepalive"}, diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c index dae8b3b3e2..a1991a7b90 100644 --- a/crypto/bio/bss_bio.c +++ b/crypto/bio/bss_bio.c @@ -280,6 +280,11 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) BIOerr(BIO_F_BIO_CTRL, BIO_R_IN_USE); ret = 0; } + else if (num == 0) + { + BIOerr(BIO_F_BIO_CTRL, BIO_R_INVALID_ARGUMENT); + ret = 0; + } else { size_t new_size = num;