projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba327ad
)
Make sure a socklen_t can compare with a sizeof() result
author
Richard Levitte
<levitte@openssl.org>
Sun, 14 Feb 2016 10:16:37 +0000
(11:16 +0100)
committer
Richard Levitte
<levitte@openssl.org>
Sun, 14 Feb 2016 10:16:37 +0000
(11:16 +0100)
Most of the times, it seems that socklen_t is unsigned.
Unfortunately, this isn't always the case, and it doesn't compare with
a size_t without warning.
A cast resolves the issue.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
crypto/bio/b_sock.c
patch
|
blob
|
history
diff --git
a/crypto/bio/b_sock.c
b/crypto/bio/b_sock.c
index 4ae08d2d8426cbbafc66ed4029aea95db268c782..eece85bb51f0491ed3f898f23d566fbb3f8eb1c3 100644
(file)
--- a/
crypto/bio/b_sock.c
+++ b/
crypto/bio/b_sock.c
@@
-432,7
+432,7
@@
int BIO_sock_info(int sock,
BIOerr(BIO_F_BIO_SOCK_INFO, BIO_R_GETSOCKNAME_ERROR);
return 0;
}
- if (addr_len > sizeof(*info->addr)) {
+ if (
(size_t)
addr_len > sizeof(*info->addr)) {
BIOerr(BIO_F_BIO_SOCK_INFO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS);
return 0;
}