projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace BUF_ string function calls with OPENSSL_ ones
[openssl.git]
/
crypto
/
bio
/
bss_acpt.c
diff --git
a/crypto/bio/bss_acpt.c
b/crypto/bio/bss_acpt.c
index 72ad6a19a913ff300c406dce54c0b11283145b1f..3d2937594e71647cb4a7819de87e0a774d004b34 100644
(file)
--- a/
crypto/bio/bss_acpt.c
+++ b/
crypto/bio/bss_acpt.c
@@
-1,7
+1,7
@@
/*
/*
- * Copyright 1995-201
6
The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-201
8
The OpenSSL Project Authors. All Rights Reserved.
*
*
- * Licensed under the
OpenSSL license
(the "License"). You may not use
+ * Licensed under the
Apache License 2.0
(the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
@@
-9,7
+9,7
@@
#include <stdio.h>
#include <errno.h>
#include <stdio.h>
#include <errno.h>
-#include "bio_l
c
l.h"
+#include "bio_l
oca
l.h"
#ifndef OPENSSL_NO_SOCK
#ifndef OPENSSL_NO_SOCK
@@
-92,8
+92,10
@@
static BIO_ACCEPT *BIO_ACCEPT_new(void)
{
BIO_ACCEPT *ret;
{
BIO_ACCEPT *ret;
- if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
+ if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
+ BIOerr(BIO_F_BIO_ACCEPT_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
return NULL;
+ }
ret->accept_family = BIO_FAMILY_IPANY;
ret->accept_sock = (int)INVALID_SOCKET;
return ret;
ret->accept_family = BIO_FAMILY_IPANY;
ret->accept_sock = (int)INVALID_SOCKET;
return ret;
@@
-103,7
+105,6
@@
static void BIO_ACCEPT_free(BIO_ACCEPT *a)
{
if (a == NULL)
return;
{
if (a == NULL)
return;
-
OPENSSL_free(a->param_addr);
OPENSSL_free(a->param_serv);
BIO_ADDRINFO_free(a->addr_first);
OPENSSL_free(a->param_addr);
OPENSSL_free(a->param_serv);
BIO_ADDRINFO_free(a->addr_first);
@@
-225,10
+226,9
@@
static int acpt_state(BIO *b, BIO_ACCEPT *c)
BIO_ADDRINFO_socktype(c->addr_iter),
BIO_ADDRINFO_protocol(c->addr_iter), 0);
if (ret == (int)INVALID_SOCKET) {
BIO_ADDRINFO_socktype(c->addr_iter),
BIO_ADDRINFO_protocol(c->addr_iter), 0);
if (ret == (int)INVALID_SOCKET) {
- SYSerr(SYS_F_SOCKET, get_last_socket_error());
- ERR_add_error_data(4,
- "hostname=", c->param_addr,
- " service=", c->param_serv);
+ ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(),
+ "calling socket(%s, %s)",
+ c->param_addr, c->param_serv);
BIOerr(BIO_F_ACPT_STATE, BIO_R_UNABLE_TO_CREATE_SOCKET);
goto exit_loop;
}
BIOerr(BIO_F_ACPT_STATE, BIO_R_UNABLE_TO_CREATE_SOCKET);
goto exit_loop;
}
@@
-432,7
+432,7
@@
static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
b->init = 1;
} else if (num == 1) {
OPENSSL_free(data->param_serv);
b->init = 1;
} else if (num == 1) {
OPENSSL_free(data->param_serv);
- data->param_serv =
BUF
_strdup(ptr);
+ data->param_serv =
OPENSSL
_strdup(ptr);
b->init = 1;
} else if (num == 2) {
data->bind_mode |= BIO_SOCK_NONBLOCK;
b->init = 1;
} else if (num == 2) {
data->bind_mode |= BIO_SOCK_NONBLOCK;