X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbio%2Fbss_bio.c;h=8590870e2cd17630eb8ca30cefdfc5eec7cf2a81;hp=dae8b3b3e2eeace87ab1b26ac5f72cdf4adcd8f2;hb=c91b5c717c89d2e976dd5095e7cb04a9f375581d;hpb=d7fcc7f6c697fb98098820ea18f6d3bc5ee0883b diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c index dae8b3b3e2..8590870e2c 100644 --- a/crypto/bio/bss_bio.c +++ b/crypto/bio/bss_bio.c @@ -7,6 +7,11 @@ * for which no specific BIO method is available. * See ssl/ssltest.c for some hints on how this can be used. */ +#ifndef BIO_PAIR_DEBUG +# undef NDEBUG /* avoid conflicting definitions */ +# define NDEBUG +#endif + #include #include #include @@ -280,6 +285,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; @@ -571,7 +581,7 @@ size_t BIO_ctrl_get_write_guarantee(BIO *bio) return BIO_ctrl(bio, BIO_C_GET_WRITE_GUARANTEE, 0, NULL); } -size_t BIO_ctrl_read_request(BIO *bio) +size_t BIO_ctrl_get_read_request(BIO *bio) { return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL); }