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 3FF54740052 for ; Mon, 26 Feb 2024 10:18:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=X8TXKF4FfmRwekJyxD4Ips04Hh3H+ccYwOlWYwN5fN8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id: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=1708942685; v=1; b=EhrxzHZ2MdnWe00ovYlI9Dot523AOLWp2twkVl/k46dv6reyJkrzpLF3MUzdn6W2PpV/evBn 9Or/hB8zcQMpzuZN69dhccuPzj5w65twgPQ0j34XQWU+Tg8yG+bNI7JFkjKvZxW1kBAzqszQCsy qHv012iVbnKvYtopQEyAh92M= X-Received: by 127.0.0.2 with SMTP id ikWLYY7687511x5K6vaOBqlW; Mon, 26 Feb 2024 02:18:05 -0800 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.17242.1708942683304737909 for ; Mon, 26 Feb 2024 02:18:05 -0800 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8BxuvBUZdxlJo8RAA--.44901S3; Mon, 26 Feb 2024 18:17:56 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxnhNSZdxl_iBFAA--.61918S2; Mon, 26 Feb 2024 18:17:54 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen Subject: [edk2-devel] [PATCH v1] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c Date: Mon, 26 Feb 2024 18:17:52 +0800 Message-Id: <20240226101752.247067-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxnhNSZdxl_iBFAA--.61918S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQATCGXcS+QDEwAAsc X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== 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,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jxAuBJp93MWA4bUGmk2uaCpkx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=EhrxzHZ2; dmarc=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 DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a bug, code: SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DEVICE_PATH))); DNS is a pointer, which is increased by a structure size and converted to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4712 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Carolyn Gjertsen Signed-off-by: Chao Li --- .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c index c96ee246..bd11c25a 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c @@ -1734,13 +1734,13 @@ CreateDNSDeviceNode ( } if (DNS->IsIPv6 == 0) { - SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DEVICE_PATH))); - SctStrToIPv4Addr (&IpStr2, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); + SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof (DNS_DEVICE_PATH))); + SctStrToIPv4Addr (&IpStr2, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); } if (DNS->IsIPv6 == 1) { - SctStrToIPv6Addr (&IpStr1, (EFI_IPv6_ADDRESS *)(DNS + sizeof (DNS_DEVICE_PATH))); - SctStrToIPv6Addr (&IpStr2, (EFI_IPv6_ADDRESS *)(DNS + sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); + SctStrToIPv6Addr (&IpStr1, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof (DNS_DEVICE_PATH))); + SctStrToIPv6Addr (&IpStr2, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); } return (EFI_DEVICE_PATH_PROTOCOL *) DNS; -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115947): https://edk2.groups.io/g/devel/message/115947 Mute This Topic: https://groups.io/mt/104579419/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-