From patchwork Tue Mar 6 22:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: C0deAi X-Patchwork-Id: 7838 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.181.170 with SMTP id m39csp4299468jaj; Tue, 6 Mar 2018 14:43:10 -0800 (PST) X-Google-Smtp-Source: AG47ELt6+bNyiWJCgA7glsMOmPAXxy56eWmYtoa/wmLMTRPxok3JMk1x6fC0gaZ1YX246MWyeBnp X-Received: by 10.28.13.136 with SMTP id 130mr13548398wmn.123.1520376190762; Tue, 06 Mar 2018 14:43:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520376190; cv=none; d=google.com; s=arc-20160816; b=XuOfGcy1pafGfVZy2+GHqwU55pwsGHKw+FJ9pDDl80js+l/42fPKmyynPXla1Pnuo4 88zLBWoA09cU0ukdSd6FZ67FAVX3RYM3uOSvvU9YzkOqiBa6WFtTtSL1f8JTQNOzpaFI C1A6XzUVTeZdJUpc31Jbrq8WSNP2ZFwNM2m0rj3jTDKv/JrnHojqfK2ic6O27hFXUN4L ynrF9L7kSCkU+/kWxfYfWC+4Z7VEDaySYL4/3+BTW01JW117cY+1nbzqVD9h2q0CQE5O xEouUnnts9LhLivW/rm9bJUzqTE9rN8rpjqGpHEOiIZjnueEeZLNnB79wcCxqyLtiDFx xINw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=8b7tNrNA2rde2Nxa6C/PTv1RFJAT6lJexw1PXoBwB/k=; b=0PVYZormD5qsZpyhnRgJScFbDf11QgrOV7xWwVA6o4adwK+5tfBaOHxYRbuMUC4nkW +DDvpIUFKMVB9/TEE8oLEKMaTQHYjRZB3dvmjA6dH+9iMvihWZ4Ma1qz0VPh0irRQyvL 1FJ1fjbyQqIiUa738vU9aQMma0ohpScnejoWqXw7qTnM21Hq7jXhHl5Fprz+rPbgfwqe AO0ZRI71+B8xjWfRmLaLCmepzyUyKkdgcLzwyQW+Ml35AK06DidnQh1OumOUv0TRwNly zVOGpZAyfrhZr4PNg0lKB2nT1HDzait70W8m/Uk//g3NUm+sqWqs0da8Vd/Ci3EFe+A+ 2DLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@mycode-ai.20150623.gappssmtp.com header.s=20150623 header.b=033Grj/B; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h9si1551283wrc.552.2018.03.06.14.43.10; Tue, 06 Mar 2018 14:43:10 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@mycode-ai.20150623.gappssmtp.com header.s=20150623 header.b=033Grj/B; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DDE6F68A45F; Wed, 7 Mar 2018 00:42:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yw0-f195.google.com (mail-yw0-f195.google.com [209.85.161.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 507BB68A2C6 for ; Wed, 7 Mar 2018 00:42:29 +0200 (EET) Received: by mail-yw0-f195.google.com with SMTP id j143so107775ywb.4 for ; Tue, 06 Mar 2018 14:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mycode-ai.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=iMEI2U5jN5bFEz3RzuCaiahRUyNLM+zilg+uGr1jOA0=; b=033Grj/Bs4MJ2f/DRy/JwMYqAPD75+mI45vH9ItcA/RrayRc9kHxR9lKDbPlxhDHoS jxorcKSSN+CW585VvpSOQ0w0k8Ld8fZU1qivvCyDsnJ0XBmnm9+l2uNUd/7yNAya1ng/ DBOSWSLda+cceXmTOEhXy91L6if3Mfrp3f6YPUM6xpr6RzJA68E1pznzluPKXCUUzh80 L7vNfCabWEGyabxsGz/PZ+H9Vb24Aq/Dvd86guae8jaSUXn8wNGqZ+LhRxu4/PoDQ0z0 zUuTGGgHTru7kavzpwCtrLybjmSdRh+FhEzwBPXStHkVn89yTp32RNi6k9s9gbaJUem4 /xOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=iMEI2U5jN5bFEz3RzuCaiahRUyNLM+zilg+uGr1jOA0=; b=c8rKz1UvLQfjqRv+si5/A5XlIoj5vEYwARQeSZybFgEHvNGoNGK7WURj/owy5tKo7X rLFLPl5mDNtjPZ/IXFJ0q8uccGK3suF8pGFwPIwMoe6uk8z93yhMSfzU0hXuVn2T7HWy ZRH9hOnck6jjn0DcX7AIEKZi2oi4K+ZFu3z2QHWLEQAaP/ntMLj9DjUPPemJeYC7wzLK c4Ldx96AOAw+aGsX5djYOEdvK6FJQCHDnwShpbL4mgk1lV6DggDkzKBfxlh0p9cqoJAX lPlmxojytXLeo5lX1cTz6Fy5fcWIhDOxXBnERRbzgoQUEm/3lkBRah2K/fXDaqc3WPPP aM5Q== X-Gm-Message-State: APf1xPCBKco3gYj+RDgkCNX/UKk29w7DnUMUMWxxjVeVjYS+OPRstdSW 4xCMTgS2lItv9mm+Pz1Q7RsZmElu8KQ= X-Received: by 10.129.79.65 with SMTP id d62mr12655186ywb.154.1520376156079; Tue, 06 Mar 2018 14:42:36 -0800 (PST) Received: from paul-desktop.hsd1.ga.comcast.net (96-87-228-86-static.hfc.comcastbusiness.net. [96.87.228.86]) by smtp.gmail.com with ESMTPSA id i67sm5068244ywc.7.2018.03.06.14.42.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Mar 2018 14:42:35 -0800 (PST) From: C0deAi X-Google-Original-From: C0deAi To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Mar 2018 17:42:21 -0500 Message-Id: <1520376143-5925-4-git-send-email-benjamin.bales@assrc.us> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520376143-5925-1-git-send-email-benjamin.bales@assrc.us> References: <1520376143-5925-1-git-send-email-benjamin.bales@assrc.us> Subject: [FFmpeg-devel] [PATCH 3/5] CodeAi generated fix for CWE 457 Uninitialized Variable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prevent passing of uninitialized value 'buf[i]' as function call argument on line 222. Signed-off-by: C0deAi --- 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);