From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id EFF3C7803CF for ; Fri, 15 Dec 2023 00:04:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hnSiPy8PMoCMp+sxBNnrM9XSP5kClEJVswnCjcLbYAw=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1702598662; v=1; b=KsBsJWSL1ZoQGeGU6LZ53Cx89ny6NcabGh5BFWuNk91Q/2VbE3EChp9gZz0CpWEtpMrw9Qgn nQJ4DCnslbw1IWCNhFeg5jTFXU/WyjbrJBOMA6jEz00KbCJBWs0ZNzapa+HwfWP5lqLvcWVDAYc tnOIwL+nng52QrZdyfykqYGc= X-Received: by 127.0.0.2 with SMTP id csfyYY7687511x3UTg6o4Lnx; Thu, 14 Dec 2023 16:04:22 -0800 X-Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by mx.groups.io with SMTP id smtpd.web11.45727.1702598661622297803 for ; Thu, 14 Dec 2023 16:04:21 -0800 X-Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-50bf898c43cso61186e87.1 for ; Thu, 14 Dec 2023 16:04:21 -0800 (PST) X-Gm-Message-State: Har3JnNLbgFaeQqescBsuuNUx7686176AA= X-Google-Smtp-Source: AGHT+IHIpsira2wq7VkXvQNtkxd0KpwaKEYY8CPd3kFJ4ldSNvfWr/AFye6zh5WWrVKNfKYWfpQpHA== X-Received: by 2002:a05:6512:2244:b0:50b:fc3e:db5e with SMTP id i4-20020a056512224400b0050bfc3edb5emr4058610lfu.131.1702598659678; Thu, 14 Dec 2023 16:04:19 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id n11-20020a0565120acb00b0050be6038170sm1991256lfu.48.2023.12.14.16.04.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Dec 2023 16:04:19 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [edk2-redfish-client][PATCH 3/4] RedfishClientPkg: fix access to unitialized variable. Date: Fri, 15 Dec 2023 03:03:59 +0300 Message-Id: <20231215000400.5311-4-mike.maslenkin@gmail.com> In-Reply-To: <20231215000400.5311-1-mike.maslenkin@gmail.com> References: <20231215000400.5311-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KsBsJWSL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io It is possible that at the time of accessing to AsciiLocation pointer the memory is not allocated. Also gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) emits a warning for this case: RedfishFeatureUtilityLib.c:1889:37: error: 'AsciiLocation' may be used unin= itialized in this function [-Werror=3Dmaybe-uninitialized] *Location =3D StrAsciiToUnicode (AsciiLocation); Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nickle Wang Signed-off-by: Mike Maslenkin --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 0f0b050d7eba..01c054ae3b70 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -1856,7 +1856,8 @@ GetEtagAndLocation ( }=0D =0D if (Location !=3D NULL) {=0D - *Location =3D NULL;=0D + *Location =3D NULL;=0D + AsciiLocation =3D NULL;=0D =0D if (*(Response->StatusCode) =3D=3D HTTP_STATUS_200_OK) {=0D Header =3D HttpFindHeader (Response->HeaderCount, Response->Headers,= HTTP_HEADER_LOCATION);=0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112576): https://edk2.groups.io/g/devel/message/112576 Mute This Topic: https://groups.io/mt/103181640/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-