diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-03-03 03:41:13 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-03-24 21:22:15 +0100 |
commit | 9dfc409e6b18d2984bdd5f041413173549e0fdd5 (patch) | |
tree | 2753bc4c56e098bb58e2aa3b65cc34ade2a00e1f /libavcodec/x86/g722dsp_init.c | |
parent | 65e8f6dd9b96df410233e80ad108e5ce57d54eae (diff) | |
download | ffmpeg-9dfc409e6b18d2984bdd5f041413173549e0fdd5.tar.gz |
avformat/hls: Don't strdup non-null-terminated string
If an URI indicated that the data protocol was in use, it would be
copied into a temporary buffer via strncpy(dst, src, strlen(src)),
thereby ensuring that the trailing \0 would not be copied, despite dst
being uninitialized. dst would then be av_strdup'ed, leading to
potential segfaults.
The solution to this is simple: Don't copy the URI in the temporary
buffer at all, instead av_strdup it directly.
This fixes a -Wstringop-truncation warning emitted by GCC 9.2.
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/x86/g722dsp_init.c')
0 files changed, 0 insertions, 0 deletions