Browse Source

replace all BIO_R_NULL_PARAMETER by ERR_R_PASSED_NULL_PARAMETER

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13713)
master
Dr. David von Oheimb 1 year ago
committed by Dr. David von Oheimb
parent
commit
ed4a9b15d9
5 changed files with 14 additions and 16 deletions
  1. +0
    -1
      crypto/bio/bio_err.c
  2. +11
    -11
      crypto/bio/bio_lib.c
  3. +2
    -2
      crypto/bio/bss_mem.c
  4. +0
    -1
      crypto/err/openssl.txt
  5. +1
    -1
      include/openssl/bioerr.h

+ 0
- 1
crypto/bio/bio_err.c View File

@ -46,7 +46,6 @@ static const ERR_STRING_DATA BIO_str_reasons[] = {
"no hostname or service specified"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_PORT_DEFINED), "no port defined"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_SUCH_FILE), "no such file"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NULL_PARAMETER), "null parameter"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_ERROR), "transfer error"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_TIMEOUT), "transfer timeout"},
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_BIND_SOCKET),


+ 11
- 11
crypto/bio/bio_lib.c View File

@ -253,7 +253,7 @@ static int bio_read_intern(BIO *b, void *data, size_t dlen, size_t *readbytes)
int ret;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (b->method == NULL || b->method->bread == NULL) {
@ -318,7 +318,7 @@ static int bio_write_intern(BIO *b, const void *data, size_t dlen,
int ret;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (b->method == NULL || b->method->bwrite == NULL) {
@ -377,7 +377,7 @@ int BIO_puts(BIO *b, const char *buf)
size_t written = 0;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (b->method == NULL || b->method->bputs == NULL) {
@ -426,7 +426,7 @@ int BIO_gets(BIO *b, char *buf, int size)
size_t readbytes = 0;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (b->method == NULL || b->method->bgets == NULL) {
@ -507,7 +507,7 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
long ret;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}
if (b->method == NULL || b->method->ctrl == NULL) {
@ -535,8 +535,8 @@ long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
long ret;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
return -1;
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -2;
}
if (b->method == NULL || b->method->callback_ctrl == NULL
|| cmd != BIO_CTRL_SET_CALLBACK) {
@ -599,7 +599,7 @@ BIO *BIO_pop(BIO *b)
BIO *ret;
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
ret = b->next_bio;
@ -649,7 +649,7 @@ BIO *BIO_find_type(BIO *bio, int type)
int mt, mask;
if (bio == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
mask = type & 0xff;
@ -672,7 +672,7 @@ BIO *BIO_find_type(BIO *bio, int type)
BIO *BIO_next(BIO *b)
{
if (b == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return b->next_bio;
@ -855,7 +855,7 @@ int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds)
int rv;
if (bio == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return -1;
}


+ 2
- 2
crypto/bio/bss_mem.c View File

@ -91,7 +91,7 @@ BIO *BIO_new_mem_buf(const void *buf, int len)
size_t sz;
if (buf == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
sz = (len < 0) ? strlen(buf) : (size_t)len;
@ -222,7 +222,7 @@ static int mem_write(BIO *b, const char *in, int inl)
BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
if (in == NULL) {
ERR_raise(ERR_LIB_BIO, BIO_R_NULL_PARAMETER);
ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
goto end;
}
if (b->flags & BIO_FLAGS_MEM_RDONLY) {


+ 0
- 1
crypto/err/openssl.txt View File

@ -2039,7 +2039,6 @@ BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED:143:\
BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED:144:no hostname or service specified
BIO_R_NO_PORT_DEFINED:113:no port defined
BIO_R_NO_SUCH_FILE:128:no such file
BIO_R_NULL_PARAMETER:115:null parameter
BIO_R_TRANSFER_ERROR:104:transfer error
BIO_R_TRANSFER_TIMEOUT:105:transfer timeout
BIO_R_UNABLE_TO_BIND_SOCKET:117:unable to bind socket


+ 1
- 1
include/openssl/bioerr.h View File

@ -106,7 +106,7 @@
# define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
# define BIO_R_NO_PORT_DEFINED 113
# define BIO_R_NO_SUCH_FILE 128
# define BIO_R_NULL_PARAMETER 115
# define BIO_R_NULL_PARAMETER 115 /* unused */
# define BIO_R_TRANSFER_ERROR 104
# define BIO_R_TRANSFER_TIMEOUT 105
# define BIO_R_UNABLE_TO_BIND_SOCKET 117


Loading…
Cancel
Save