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

Filip Roséen git at videolan.org
Fri Feb 26 17:48:45 CET 2016


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

realrtsptsp: 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>

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

 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