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 6457A7803CF for ; Tue, 27 Feb 2024 06:37:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=079LP98Q7NuOFTkzNDAZ40RJYAofIt0s5JUg07CLApM=; 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=1709015874; v=1; b=vRF2v8TxAgqJAI542NJhwXB5O/OL1FSfUj05lOO+6Q3pcCF14JHJQP49qITkKqDfufsXwTiS OUgTV9ctCQ2qcvhYiqcANF+NrzvCT5AmYPvRCERc8C5/7RYNW31x4a5X/mR0V+eNsk0k0EpTdl2 ULGN8qXnF8rNR6dSrlG08WUg= X-Received: by 127.0.0.2 with SMTP id VFGJYY7687511xrxEGA69GnF; Mon, 26 Feb 2024 22:37:54 -0800 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.7025.1709015873502207093 for ; Mon, 26 Feb 2024 22:37:54 -0800 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8Bxnus5g91lr9gRAA--.44888S3; Tue, 27 Feb 2024 14:37:45 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxfRMyg91lGF9HAA--.25630S2; Tue, 27 Feb 2024 14:37:38 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen , Samer El-Haj-Mahmoud , Eric Jin , Arvin Chen , Supreeth Venkatesh , Heinrich Schuchardt Subject: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c Date: Tue, 27 Feb 2024 14:37:37 +0800 Message-Id: <20240227063737.1675884-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxfRMyg91lGF9HAA--.25630S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAACGXcS+QJPAABsr 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: SCWcVSFNrVJJwFQg8Bz8zV7fx7686176AA= 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=vRF2v8Tx; 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. Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct-Wincompatible-pointer-types warnings") BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4712 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Carolyn Gjertsen Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Supreeth Venkatesh Cc: Heinrich Schuchardt 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 (#116004): https://edk2.groups.io/g/devel/message/116004 Mute This Topic: https://groups.io/mt/104598721/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-