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

Pierre Lamot git at videolan.org
Wed May 16 19:07:34 CEST 2018


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed May 16 13:24:50 2018 +0200| [e7383792e7ce07673fabc9320f0de7cbf1151fe3] | 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>

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

 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 1de21059a9..e4e31b637d 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -602,7 +602,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;
@@ -615,13 +614,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