aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index ee3d176d9..f033dbc95 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3627,7 +3627,7 @@ static void fix_hostname(struct SessionHandle *data,
host->dispname = host->name;
len = strlen(host->name);
- if(host->name[len-1] == '.')
+ if(len && (host->name[len-1] == '.'))
/* strip off a single trailing dot if present, primarily for SNI but
there's no use for it */
host->name[len-1]=0;