From c5a7c603813f5f0e1f6ff222b3e31e8b8c1b0132 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 29 Aug 2022 17:09:47 +0000 Subject: [PATCH] Silence some code analysis warnings --- ncat/ncat.vcxproj | 5 +++-- ncat/ncat_ssl.c | 2 +- ncat/util.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ncat/ncat.vcxproj b/ncat/ncat.vcxproj index a77805838..38f50b8a0 100644 --- a/ncat/ncat.vcxproj +++ b/ncat/ncat.vcxproj @@ -62,7 +62,8 @@ .\Release\ .\Release\ .\Release\ - true + + true @@ -258,4 +259,4 @@ - + \ No newline at end of file diff --git a/ncat/ncat_ssl.c b/ncat/ncat_ssl.c index bc9bdc11f..9226b4811 100644 --- a/ncat/ncat_ssl.c +++ b/ncat/ncat_ssl.c @@ -224,7 +224,7 @@ static int wildcard_match(const char *pattern, const char *hostname, int len) /* Ensure there's at least one more dot, not counting a dot at the end. */ - dot = memchr(p, '.', remaining); + dot = (const char *) memchr(p, '.', remaining); if (dot == NULL /* not found */ || dot - p == remaining /* dot in last position */ || *(dot + 1) == '\0') /* dot immediately before null terminator */ diff --git a/ncat/util.c b/ncat/util.c index a93441ece..ac83819bd 100644 --- a/ncat/util.c +++ b/ncat/util.c @@ -332,7 +332,7 @@ const char *inet_socktop(const union sockaddr_u *su) addr = (void *) &su->in6.sin6_addr; #endif else - addr = NULL; + bye("Invalid address family passed to inet_socktop()."); if (inet_ntop(su->storage.ss_family, addr, buf, sizeof(buf)) == NULL) { bye("Failed to convert address to presentation format! Error: %s.",