Fix SonarCloud complaint.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2024-08-14 13:19:13 +02:00
parent 8271f15e25
commit 68e0c1f280

View File

@@ -655,6 +655,11 @@ static inline void nDPIsrvd_socket_free(struct nDPIsrvd_socket ** const sock)
static inline int nDPIsrvd_setup_address(struct nDPIsrvd_address * const address, char const * const destination) static inline int nDPIsrvd_setup_address(struct nDPIsrvd_address * const address, char const * const destination)
{ {
if (address == NULL || destination == NULL)
{
return 1;
}
size_t len = strlen(destination); size_t len = strlen(destination);
char const * first_colon = strchr(destination, ':'); char const * first_colon = strchr(destination, ':');
char const * last_colon = strrchr(destination, ':'); char const * last_colon = strrchr(destination, ':');