Unverified Commit 354aa328 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

strip_trailing_dot: make sure NULL is never used for strlen

scan-build warning: Null pointer passed as an argument to a 'nonnull'
parameter
parent 4015fae0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;