mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 09:08:49 -05:00
strip_trailing_dot: make sure NULL is never used for strlen
scan-build warning: Null pointer passed as an argument to a 'nonnull' parameter
This commit is contained in:
parent
4015fae044
commit
354aa32820
@ -1686,6 +1686,8 @@ static bool is_ASCII_name(const char *hostname)
|
|||||||
static void strip_trailing_dot(struct hostname *host)
|
static void strip_trailing_dot(struct hostname *host)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
if(!host || !host->name)
|
||||||
|
return;
|
||||||
len = strlen(host->name);
|
len = strlen(host->name);
|
||||||
if(len && (host->name[len-1] == '.'))
|
if(len && (host->name[len-1] == '.'))
|
||||||
host->name[len-1] = 0;
|
host->name[len-1] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user