diff --git a/sys/net/sock/sock_util.c b/sys/net/sock/sock_util.c
index fbb8c0449d6d86ab0a3334a163eee2858fc86489..428de248200cfbfd4def48f06edfb205d4d2fb54 100644
--- a/sys/net/sock/sock_util.c
+++ b/sys/net/sock/sock_util.c
@@ -133,6 +133,7 @@ int sock_urlsplit(const char *url, char *hostport, char *urlpath)
         return -EOVERFLOW;
     }
     memcpy(hostport, hoststart, hostlen);
+    *(hostport + hostlen) = '\0';
 
     size_t pathlen = strlen(pathstart);
     if (pathlen) {