Skip to content
Snippets Groups Projects
Unverified Commit d93ecab8 authored by Koen Zandberg's avatar Koen Zandberg
Browse files

sock_util: Add terminator to host-port string

Add missing null terminator to the returned host-port string in
sock_udp_ep_fmt
parent b8a494fb
No related branches found
No related tags found
No related merge requests found
...@@ -133,6 +133,7 @@ int sock_urlsplit(const char *url, char *hostport, char *urlpath) ...@@ -133,6 +133,7 @@ int sock_urlsplit(const char *url, char *hostport, char *urlpath)
return -EOVERFLOW; return -EOVERFLOW;
} }
memcpy(hostport, hoststart, hostlen); memcpy(hostport, hoststart, hostlen);
*(hostport + hostlen) = '\0';
size_t pathlen = strlen(pathstart); size_t pathlen = strlen(pathstart);
if (pathlen) { if (pathlen) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment