Skip to content

Commit

Permalink
vlc_path2_uri: fix off-by-one
Browse files Browse the repository at this point in the history
Pointed-out-by: Zoran Turalija <[email protected]>
  • Loading branch information
Rémi Denis-Courmont committed Mar 31, 2015
1 parent 0e8b747 commit 8a9fa0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/text/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ char *vlc_path2uri (const char *path, const char *scheme)
/* \\host\share\path -> file://host/share/path */
size_t hostlen = strcspn (path + 2, DIR_SEP);

buf = malloc (7 + hostlen);
if (buf != NULL)
snprintf (buf, 7 + hostlen, "file://%s", path + 2);
if (asprintf (&buf, "file://%s", path + 2) == -1)
buf = NULL;
path += 2 + hostlen;

if (path[0] == '\0')
Expand Down

0 comments on commit 8a9fa0b

Please sign in to comment.