summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-18 15:08:17 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-18 15:08:35 +0300
commit9397a2e125009678da9465770910b24fadaaee2e (patch)
treebb8b11c9ad64f2e76e3a89720a1e54b8b1503c7b
parent178b8fa5afa7cf4c9c7d63c0f09d4f08149adf66 (diff)
Dealing with a missing host name
-rw-r--r--src/gmutil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gmutil.c b/src/gmutil.c
index c0eda099..cca930cc 100644
--- a/src/gmutil.c
+++ b/src/gmutil.c
@@ -290,7 +290,8 @@ const iString *absoluteUrl_String(const iString *d, const iString *urlMaybeRelat
290 appendCStr_String(absolute, "://"); 290 appendCStr_String(absolute, "://");
291 /* Authority. */ { 291 /* Authority. */ {
292 const iUrl *selHost = isDef_(rel.host) ? &rel : &orig; 292 const iUrl *selHost = isDef_(rel.host) ? &rel : &orig;
293 const iBool isIPv6 = iStrStrN(selHost->host.start, ":", size_Range(&selHost->host)) != NULL; 293 const iBool isIPv6 = size_Range(&selHost->host) > 0 &&
294 iStrStrN(selHost->host.start, ":", size_Range(&selHost->host)) != NULL;
294 iString *decHost = punyDecodeHost_(selHost->host); 295 iString *decHost = punyDecodeHost_(selHost->host);
295 if (isIPv6) { 296 if (isIPv6) {
296 appendCStr_String(absolute, "["); 297 appendCStr_String(absolute, "[");