mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 17:55:21 +00:00
rtsp: Check for command strings without spaces
Prevent a NULL-pointer dereference. CC: libav-stable@libav.org
This commit is contained in:
parent
09e1ccc8cd
commit
c27328e749
@ -360,6 +360,10 @@ static inline int parse_command_line(AVFormatContext *s, const char *line,
|
|||||||
RTSPState *rt = s->priv_data;
|
RTSPState *rt = s->priv_data;
|
||||||
const char *linept, *searchlinept;
|
const char *linept, *searchlinept;
|
||||||
linept = strchr(line, ' ');
|
linept = strchr(line, ' ');
|
||||||
|
|
||||||
|
if (!linept)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
if (linept - line > methodsize - 1) {
|
if (linept - line > methodsize - 1) {
|
||||||
av_log(s, AV_LOG_ERROR, "Method string too long\n");
|
av_log(s, AV_LOG_ERROR, "Method string too long\n");
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
Loading…
Reference in New Issue
Block a user