[libav-stable] rtsp: Check for command strings without spaces

Luca Barbato git at libav.org
Fri Oct 10 17:27:17 CEST 2014


Module: libav
Branch: master
Commit: c27328e749ff3be648411765cd17362fee017341

Author:    Luca Barbato <lu_zero at gentoo.org>
Committer: Luca Barbato <lu_zero at gentoo.org>
Date:      Thu Oct  9 20:13:54 2014 +0200

rtsp: Check for command strings without spaces

Prevent a NULL-pointer dereference.

CC: libav-stable at libav.org

---

 libavformat/rtspdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index a14ec57..5442b7d 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -360,6 +360,10 @@ static inline int parse_command_line(AVFormatContext *s, const char *line,
     RTSPState *rt = s->priv_data;
     const char *linept, *searchlinept;
     linept = strchr(line, ' ');
+
+    if (!linept)
+        return AVERROR_INVALIDDATA;
+
     if (linept - line > methodsize - 1) {
         av_log(s, AV_LOG_ERROR, "Method string too long\n");
         return AVERROR(EIO);



More information about the libav-stable mailing list