From c27acf55eca26e4dcb390053a319426a05ee1d7f Mon Sep 17 00:00:00 2001 From: Li zeming Date: Mon, 1 Aug 2022 11:08:09 +0800 Subject: [PATCH 1/2] util/arc4random: (void*) type pointer passing address could remove cast Signed-off-by: Li zeming --- lib/util/arc4random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/arc4random.c b/lib/util/arc4random.c index fa892fb60..a51791928 100644 --- a/lib/util/arc4random.c +++ b/lib/util/arc4random.c @@ -150,7 +150,7 @@ _rs_rekey(unsigned char *dat, size_t datlen) static inline void _rs_random_buf(void *_buf, size_t n) { - unsigned char *buf = (unsigned char *)_buf; + unsigned char *buf = _buf; unsigned char *keystream; size_t m; From 393d9997cbc4798e2cb22f4518fbc024ed9d6706 Mon Sep 17 00:00:00 2001 From: Li zeming Date: Mon, 1 Aug 2022 10:46:56 +0800 Subject: [PATCH 2/2] iolog/hostcheck: These two parameters do not need to be initialized and assigned, the following code is directly assigned Signed-off-by: Li zeming --- lib/iolog/hostcheck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/iolog/hostcheck.c b/lib/iolog/hostcheck.c index 95c14d059..d23514e8b 100644 --- a/lib/iolog/hostcheck.c +++ b/lib/iolog/hostcheck.c @@ -188,7 +188,7 @@ matches_common_name(const char *hostname, const char *ipaddr, const X509 *cert, { X509_NAME_ENTRY *common_name_entry = NULL; ASN1_STRING *common_name_asn1 = NULL; - int common_name_loc = -1; + int common_name_loc; debug_decl(matches_common_name, SUDO_DEBUG_UTIL); /* Find the position of the CN field in the Subject field of the certificate */ @@ -268,7 +268,7 @@ matches_subject_alternative_name(const char *hostname, const char *ipaddr, const { HostnameValidationResult result = MatchNotFound; int i; - int san_names_nb = -1; + int san_names_nb; STACK_OF(GENERAL_NAME) *san_names = NULL; debug_decl(matches_subject_alternative_name, SUDO_DEBUG_UTIL);