[FFmpeg-cvslog] ffserver_config: check strchr() return for NULL

Reynaldo H. Verdejo Pinochet git at videolan.org
Tue Dec 9 05:12:35 CET 2014


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com> | Mon Dec  8 12:42:39 2014 -0300| [f95cfff07765912676cc613b55e2234b5d70f1bd] | committer: Reynaldo H. Verdejo Pinochet

ffserver_config: check strchr() return for NULL

Should fix FFmpeg Coverity Scan issue #1257013

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>

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

 ffserver_config.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index ccc35d7..51e3f49 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -520,7 +520,13 @@ static int ffserver_save_avoption(const char *opt, const char *arg, int type, FF
         //explicit private option
         snprintf(buff, sizeof(buff), "%s", opt);
         codec_name = buff;
-        option = strchr(buff, ':');
+        if(!(option = strchr(buff, ':'))){
+            report_config_error(config->filename, config->line_num,
+                                AV_LOG_ERROR, &config->errors,
+                                "Syntax error. Unmatched ':'\n");
+            return -1;
+
+        }
         buff[option - buff] = '\0';
         option++;
         if ((ret = ffserver_set_codec(ctx, codec_name, config)) < 0)



More information about the ffmpeg-cvslog mailing list