Commit d2bb4d1b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vlc_path2uri: really fix off-by-one error

parent 8f86a6e2
......@@ -193,9 +193,9 @@ char *vlc_path2uri (const char *path, const char *scheme)
if (!strncmp (path, "\\\\", 2))
{ /* Windows UNC paths */
/* \\host\share\path -> file://host/share/path */
size_t hostlen = strcspn (path + 2, DIR_SEP);
int hostlen = strcspn (path + 2, DIR_SEP);
if (asprintf (&buf, "file://%s", path + 2) == -1)
if (asprintf (&buf, "file://%.*s", hostlen, path + 2) == -1)
buf = NULL;
path += 2 + hostlen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment