#include <stdio.h>
#include <errno.h>
#define USE_SOCKETS
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/bio.h>
#ifndef OPENSSL_NO_SOCK
case BIO_CONN_S_CREATE_SOCKET:
/* now setup address */
- memset((char *)&c->them, 0, sizeof(c->them));
+ memset(&c->them, 0, sizeof(c->them));
c->them.sin_family = AF_INET;
c->them.sin_port = htons((unsigned short)c->port);
l = (unsigned long)
}
if (cb != NULL) {
- if (!(ret = cb((BIO *)b, c->state, ret)))
+ if ((ret = cb((BIO *)b, c->state, ret)) == 0)
goto end;
}
}
{
BIO_CONNECT *ret;
- if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
+ if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
return (NULL);
ret->state = BIO_CONN_S_BEFORE;
ret->param_hostname = NULL;
ret->param_port = NULL;
ret->info_callback = NULL;
- ret->nbio = 0;
- ret->ip[0] = 0;
- ret->ip[1] = 0;
- ret->ip[2] = 0;
- ret->ip[3] = 0;
- ret->port = 0;
- memset((char *)&ret->them, 0, sizeof(ret->them));
return (ret);
}