This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new bfac54a03b avformat/hlsenc: reject hls_enc_key and hls_enc_iv values
shorter than 16 bytes
bfac54a03b is described below
commit bfac54a03b9c1046d8956b9674bb21167e230eb9
Author: Michael Niedermayer <[email protected]>
AuthorDate: Tue Sep 15 06:09:01 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Sat Sep 19 03:01:13 2026 +0000
avformat/hlsenc: reject hls_enc_key and hls_enc_iv values shorter than 16
bytes
do_encrypt() copied 16 bytes from each option string without checking
Fixes: heap buffer overflow (read)
Fixes: XoynvIRQMj1M
Found-by: Zheng Yu @ Depthfirst
---
libavformat/hlsenc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1e49b63b2b..e35af34d23 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -670,6 +670,9 @@ static int do_encrypt(AVFormatContext *s, VariantStream *vs)
if (!hls->iv) {
AV_WB64(iv + 8, vs->sequence);
+ } else if (strlen(hls->iv) < sizeof(iv)) {
+ av_log(hls, AV_LOG_ERROR, "hls_enc_iv is shorter than %zu
bytes\n", sizeof(iv));
+ return AVERROR(EINVAL);
} else {
memcpy(iv, hls->iv, sizeof(iv));
}
@@ -694,6 +697,9 @@ static int do_encrypt(AVFormatContext *s, VariantStream *vs)
av_log(s, AV_LOG_ERROR, "Cannot generate a strong random
key\n");
return ret;
}
+ } else if (strlen(hls->key) < sizeof(key)) {
+ av_log(hls, AV_LOG_ERROR, "hls_enc_key is shorter than %zu
bytes\n", sizeof(key));
+ return AVERROR(EINVAL);
} else {
memcpy(key, hls->key, sizeof(key));
}
--
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]