Skip to content

Commit

Permalink
audioscrobbler: check the submission URLs after handshake
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
jonas-lundqvist authored and jbkempf committed Nov 25, 2015
1 parent f016bce commit 2e4030a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/misc/audioscrobbler.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,12 @@ static int Handshake(intf_thread_t *p_this)

vlc_UrlParse(&p_sys->p_nowp_url, psz_url);
free(psz_url);
if (p_sys->p_nowp_url.psz_host == NULL ||
p_sys->p_nowp_url.i_port == 0)
{
vlc_UrlClean(&p_sys->p_nowp_url);
goto proto;
}

p_buffer_pos = strstr(p_buffer_pos, "http://");
if (!p_buffer_pos || strlen(p_buffer_pos) == 7)
Expand All @@ -631,6 +637,13 @@ static int Handshake(intf_thread_t *p_this)
/* parse the submission url */
vlc_UrlParse(&p_sys->p_submit_url, psz_url);
free(psz_url);
if (p_sys->p_submit_url.psz_host == NULL ||
p_sys->p_submit_url.i_port == 0)
{
vlc_UrlClean(&p_sys->p_nowp_url);
vlc_UrlClean(&p_sys->p_submit_url);
goto proto;
}

return VLC_SUCCESS;

Expand Down

0 comments on commit 2e4030a

Please sign in to comment.