Lagrange [work/v1.7]

Dealing with a missing host name

=> fb9b916075465d08648e49b9767e248a2a4bdff7

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
     appendCStr_String(absolute, "://");
     /* Authority. */ {
         const iUrl *selHost = isDef_(rel.host) ? &rel : &orig;
-        const iBool isIPv6 = iStrStrN(selHost->host.start, ":", size_Range(&selHost->host)) != NULL;
+        const iBool isIPv6 = size_Range(&selHost->host) > 0 &&
+                             iStrStrN(selHost->host.start, ":", size_Range(&selHost->host)) != NULL;
         iString *decHost = punyDecodeHost_(selHost->host);
         if (isIPv6) {
             appendCStr_String(absolute, "[");
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.7/cdiff/fb9b916075465d08648e49b9767e248a2a4bdff7
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
58.28921 milliseconds
Gemini-to-HTML Time
0.170377 milliseconds

This content has been proxied by September (ba2dc).