From 71faab72b8b49819d8bcf065b039d1d840e8b76c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 1 Oct 2022 18:44:38 +0200 Subject: [PATCH] Cast socklen_t to size_t in assert comparison This causes a warning otherwise when socklen_t is signed (Watt32). Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19322) --- crypto/bio/bss_dgram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 97600e4cd39..6ec43b1bc5b 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -765,7 +765,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling getsockopt()"); } else { - OPENSSL_assert(sz <= sizeof(struct timeval)); + OPENSSL_assert((size_t)sz <= sizeof(struct timeval)); ret = (int)sz; } # endif @@ -816,7 +816,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling getsockopt()"); } else { - OPENSSL_assert(sz <= sizeof(struct timeval)); + OPENSSL_assert((size_t)sz <= sizeof(struct timeval)); ret = (int)sz; } # endif -- 2.47.3