[vlc-commits] realrtsp: fixed endless iteration on unexpected data

Filip Roséen git at videolan.org
Fri Feb 26 20:46:47 CET 2016


vlc/vlc-2.2 | branch: master | Filip Roséen <filip at atch.se> | Thu Feb 25 10:12:31 2016 +0100| [aa506dbf5d46c4dd7755f7525653e3ce1f1528ba] | committer: Jean-Baptiste Kempf

realrtsp: fixed endless iteration on unexpected data

Given the below (example) correspondance with a remote-server, the
module will iterate endlessly since we never move to the next line to
process.

% nc -l -p 8080 <<EOF
> RTSP/1.0 200 OK
> CSeq: 1
> Server: Real
> RealChallenge1: foobar
>
> RTSP/1.0 200 OK
> CSeq: 1
> ETag: hello world
> Content-Length: 5
>
> m=123
>

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

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

 modules/access/rtsp/real_sdpplin.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access/rtsp/real_sdpplin.c b/modules/access/rtsp/real_sdpplin.c
index 341efd7..0f56ce8 100644
--- a/modules/access/rtsp/real_sdpplin.c
+++ b/modules/access/rtsp/real_sdpplin.c
@@ -211,7 +211,8 @@ sdpplin_t *sdpplin_parse(access_t *p_access, char *data)
 
     if (filter(p_access, data, "m=", &buf, BUFLEN)) {
         if ( !desc->stream ) {
-            fprintf(stderr, "sdpplin.c: stream identifier found before stream count, skipping.");
+            msg_Warn(p_access, "sdpplin.c: stream identifier found before stream count, skipping.");
+            data = nl(data);
             continue;
         }
         stream=sdpplin_parse_stream(p_access, &data);



More information about the vlc-commits mailing list