[FFmpeg-devel] [PATCH] avformat/hlsenc: fix CID 1405135

Steven Liu lingjiujianke at gmail.com
Fri Apr 28 05:20:59 EEST 2017


2017-04-26 16:43 GMT+08:00 Steven Liu <lq at chinaffmpeg.org>:

> Fixes Coverity CID: 1405135
>
> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
> ---
>  libavformat/hlsenc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 3ec0f330fb..b7aafb73da 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -394,11 +394,11 @@ static int do_encrypt(AVFormatContext *s)
>      av_strlcat(hls->key_basename, ".key", len);
>
>      if (hls->key_url) {
> -        strncpy(hls->key_file, hls->key_url, sizeof(hls->key_file));
> -        strncpy(hls->key_uri, hls->key_url, sizeof(hls->key_uri));
> +        av_strlcpy(hls->key_file, hls->key_url, sizeof(hls->key_file));
> +        av_strlcpy(hls->key_uri, hls->key_url, sizeof(hls->key_uri));
>      } else {
> -        strncpy(hls->key_file, hls->key_basename, sizeof(hls->key_file));
> -        strncpy(hls->key_uri, hls->key_basename, sizeof(hls->key_uri));
> +        av_strlcpy(hls->key_file, hls->key_basename,
> sizeof(hls->key_file));
> +        av_strlcpy(hls->key_uri, hls->key_basename, sizeof(hls->key_uri));
>      }
>
>      if (!*hls->iv_string) {
> --
> 2.11.0 (Apple Git-81)
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


Applied!



Thanks


More information about the ffmpeg-devel mailing list