diff options
author | Andy Polyakov <appro@openssl.org> | 2006-01-02 12:26:36 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2006-01-02 12:26:36 +0000 |
commit | 4eb76e23970d65c0587e1b0ba5e9630c4571aec5 (patch) | |
tree | b5bfa51729eb1f7f52392166f501d19aac0cd240 /crypto/bio | |
parent | 68e575362fb80bdf8133a830f15ff3f25bfae58e (diff) |
Fix typo and purify logic in b_sock.c
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_sock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 26aa9dc8da..bbf627de55 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -802,10 +802,10 @@ int BIO_accept(int sock, char **addr) if ((*getnameinfo.f)(&from,sizeof(from),h,sizeof(h),s,sizeof(s), NI_NUMERICHOST|NI_NUMERICSERV)) break; - l = strlen(h)+strlen(p)+2; if (len<24) len=24; + l = strlen(h)+strlen(s)+2; if (len<24) len=24; p = *addr; - if (p) p = OPENSSL_realloc(p,l); - else p = OPENSSL_malloc(l); + if (p) { *p = '\0'; p = OPENSSL_realloc(p,l); } + else { p = OPENSSL_malloc(l); } if (p==NULL) { BIOerr(BIO_F_BIO_ACCEPT,ERR_R_MALLOC_FAILURE); |