about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-02-01 17:41:19 +0100
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-02-01 17:41:19 +0100
commit569525c6c77552809298c9828e0b1b1c6d6e4c34 (patch)
tree0769965874873cfdb0bfde726cc38c2a04e2b8d0 /src
parentad87bdffc286aa4a32b350869c2e70af9630c0a2 (diff)
downloadprofani-tty-569525c6c77552809298c9828e0b1b1c6d6e4c34.tar.gz
Fix off-by-one
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index 3b389814..57de5ad1 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -935,7 +935,7 @@ _split_url(const char* alturi, gchar** host, gint* port)
     char* last = strrchr(alturi, ':');
     if (first) {
         if (first == last) {
-            hostlen = last - alturi;
+            hostlen = last - alturi + 1;
             if (!strtoi_range(last + 1, port, 1, 65535, NULL))
                 return FALSE;
         } else {
@@ -949,7 +949,7 @@ _split_url(const char* alturi, gchar** host, gint* port)
                 *port = 0;
             } else {
                 /* `[ip:v6]:port` */
-                hostlen = last - alturi;
+                hostlen = last - alturi + 1;
                 if (!strtoi_range(last + 1, port, 1, 65535, NULL))
                     return FALSE;
             }