diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-02-13 13:20:41 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-02-14 23:30:43 +0100 |
commit | 354aa32820914cc95a0a23ce1fc27d2abe1be065 (patch) | |
tree | 11c6059db456f3e6a72daecf45916be1a0696be8 | |
parent | 4015fae044ce52a639c9358e22a9e948f287c89f (diff) | |
download | curl-354aa32820914cc95a0a23ce1fc27d2abe1be065.tar.gz |
strip_trailing_dot: make sure NULL is never used for strlen
scan-build warning: Null pointer passed as an argument to a 'nonnull'
parameter
-rw-r--r-- | lib/url.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |