From 354aa32820914cc95a0a23ce1fc27d2abe1be065 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 13 Feb 2019 13:20:41 +0100 Subject: strip_trailing_dot: make sure NULL is never used for strlen scan-build warning: Null pointer passed as an argument to a 'nonnull' parameter --- lib/url.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/url.c b/lib/url.c index 46c8fb5fb..335889903 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1686,6 +1686,8 @@ static bool is_ASCII_name(const char *hostname) static void strip_trailing_dot(struct hostname *host) { size_t len; + if(!host || !host->name) + return; len = strlen(host->name); if(len && (host->name[len-1] == '.')) host->name[len-1] = 0; -- cgit v1.2.1