提交 59d9bb59 编写于 作者: R Richard Levitte

Make sure a socklen_t can compare with a sizeof() result

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: NKurt Roeckx <kurt@openssl.org>
上级 ba327ade
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册