[FFmpeg-devel,08/11] avfilter/vf_signature: use av_strlcpy instead of strcpy

Submitted by Timo Rothenpieler on June 11, 2017, 2:05 p.m.

Details

Message ID 20170611140551.11844-8-timo@rothenpieler.org
State New
Headers show

Commit Message

Timo Rothenpieler June 11, 2017, 2:05 p.m.
Fixes CID 1403236
---
 libavfilter/vf_signature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer June 12, 2017, 10:15 p.m.
On Sun, Jun 11, 2017 at 04:05:50PM +0200, Timo Rothenpieler wrote:
> Fixes CID 1403236
> ---
>  libavfilter/vf_signature.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
> index f0078ba1a6..c20b0bfabb 100644
> --- a/libavfilter/vf_signature.c
> +++ b/libavfilter/vf_signature.c
> @@ -576,7 +576,7 @@ static int export(AVFilterContext *ctx, StreamContext *sc, int input)
>          /* error already handled */
>          av_assert0(av_get_frame_filename(filename, sizeof(filename), sic->filename, input) == 0);
>      } else {
> -        strcpy(filename, sic->filename);
> +        av_strlcpy(filename, sic->filename, sizeof(filename));

missing error handling, if its truncated
but better than before, so patch ok

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index f0078ba1a6..c20b0bfabb 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -576,7 +576,7 @@  static int export(AVFilterContext *ctx, StreamContext *sc, int input)
         /* error already handled */
         av_assert0(av_get_frame_filename(filename, sizeof(filename), sic->filename, input) == 0);
     } else {
-        strcpy(filename, sic->filename);
+        av_strlcpy(filename, sic->filename, sizeof(filename));
     }
     if (sic->format == FORMAT_XML) {
         return xml_export(ctx, sc, filename);