[FFmpeg-cvslog] ffmpeg_opt: avoid strcpy()

Michael Niedermayer git at videolan.org
Tue Mar 26 01:59:06 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 26 01:50:23 2013 +0100| [bd03afb5bb480049abfe940d6dd2e672c29b2d73] | committer: Michael Niedermayer

ffmpeg_opt: avoid strcpy()

This fixes a warning on openbsd and is more robust

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg_opt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 716696c..a134274 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2137,7 +2137,7 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
 
         if (strcspn(line, "#\n\r") == 0)
             continue;
-        strcpy(tmp_line, line);
+        av_strlcpy(tmp_line, line, sizeof(tmp_line));
         if (!av_strtok(key,   "=",    &value) ||
             !av_strtok(value, "\r\n", &endptr)) {
             av_log(NULL, AV_LOG_FATAL, "%s: Invalid syntax: '%s'\n", filename, line);



More information about the ffmpeg-cvslog mailing list