[FFmpeg-devel] [PATCH 3/5] CodeAi generated fix for CWE 457 Uninitialized Variable

C0deAi techsupport at mycode.ai
Wed Mar 7 00:42:21 EET 2018


Prevent passing of uninitialized value 'buf[i]' as function
call argument on line 222.

Signed-off-by: C0deAi <benjamin.bales at assrc.us>
---
 libavutil/hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hash.c b/libavutil/hash.c
index 75edb6d..593176c 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -214,7 +214,7 @@ void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size)
 
 void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size)
 {
-    uint8_t buf[AV_HASH_MAX_SIZE];
+    uint8_t buf[AV_HASH_MAX_SIZE] = {0};
     unsigned rsize = av_hash_get_size(ctx), i;
 
     av_hash_final(ctx, buf);
-- 
2.7.4



More information about the ffmpeg-devel mailing list