[vlc-commits] audioscrobbler: fix url parsing in handshake

Pierre Lamot git at videolan.org
Wed May 16 19:09:31 CEST 2018


vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed May 16 13:24:50 2018 +0200| [cbb72621b3e05e85f910f3e175ebbf40735df70c] | committer: Jean-Baptiste Kempf

audioscrobbler: fix url parsing in handshake

vlc_UrlParse expects the scheme to be present

  fixes: #19415 #19916

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit e7383792e7ce07673fabc9320f0de7cbf1151fe3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cbb72621b3e05e85f910f3e175ebbf40735df70c
---

 modules/misc/audioscrobbler.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 133829a0e9..709d810575 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -603,7 +603,6 @@ static int Handshake(intf_thread_t *p_this)
         goto proto;
 
     /* We need to read the nowplaying url */
-    p_buffer_pos += 7; /* we skip "http://" */
     psz_url = strndup(p_buffer_pos, strcspn(p_buffer_pos, "\n"));
     if (!psz_url)
         goto oom;
@@ -616,13 +615,13 @@ static int Handshake(intf_thread_t *p_this)
         vlc_UrlClean(&p_sys->p_nowp_url);
         goto proto;
     }
+    p_buffer_pos += strcspn(p_buffer_pos, "\n");
 
     p_buffer_pos = strstr(p_buffer_pos, "http://");
     if (!p_buffer_pos || strlen(p_buffer_pos) == 7)
         goto proto;
 
     /* We need to read the submission url */
-    p_buffer_pos += 7; /* we skip "http://" */
     psz_url = strndup(p_buffer_pos, strcspn(p_buffer_pos, "\n"));
     if (!psz_url)
         goto oom;



More information about the vlc-commits mailing list