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

vlc_path2_uri: fix off-by-one

Pointed-out-by: default avatarZoran Turalija <zoran.turalija@gmail.com>
parent 0e8b7471
...@@ -195,9 +195,8 @@ char *vlc_path2uri (const char *path, const char *scheme) ...@@ -195,9 +195,8 @@ char *vlc_path2uri (const char *path, const char *scheme)
/* \\host\share\path -> file://host/share/path */ /* \\host\share\path -> file://host/share/path */
size_t hostlen = strcspn (path + 2, DIR_SEP); size_t hostlen = strcspn (path + 2, DIR_SEP);
buf = malloc (7 + hostlen); if (asprintf (&buf, "file://%s", path + 2) == -1)
if (buf != NULL) buf = NULL;
snprintf (buf, 7 + hostlen, "file://%s", path + 2);
path += 2 + hostlen; path += 2 + hostlen;
if (path[0] == '\0') if (path[0] == '\0')
......
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