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 2633E780091 for ; Tue, 27 Feb 2024 14:04:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=x2MMFpa4MByWgXVFzZHZsyYFwJve951NmERNaxiH/v4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1709042653; v=1; b=hfjA3VwX4SrJOHPeINMu2G4CoPeKGPlT1X8E8JSee4KbYGJskpvQ7k0KccTeE7XGsLakpJ0h xyu6VT+bT26zpyl5YOex7h6eVdHLNSAsBr/XrQNUYM/dWxjX1uq/vBFB20P8NyLpm+GZhveaEIR EjwNpuaFLnGk663tv9VPbnwg= X-Received: by 127.0.0.2 with SMTP id oXySYY7687511x1WxlILlOUd; Tue, 27 Feb 2024 06:04:13 -0800 X-Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mx.groups.io with SMTP id smtpd.web10.12934.1709042652300677285 for ; Tue, 27 Feb 2024 06:04:12 -0800 X-Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 7A46441049 for ; Tue, 27 Feb 2024 14:04:09 +0000 (UTC) X-Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2d23293d981so27816611fa.3 for ; Tue, 27 Feb 2024 06:04:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVdA47Pv0xmX7VAcV6wD4KCKJOnc4ZRBngwAbRnEmNjzKikBJDMC50sdFt1y8qeJ0WTJuvoKBPiK4chuk8OIt0koICYCg== X-Gm-Message-State: bnXURo7bPZeanxpFUx08i9Ikx7686176AA= X-Received: by 2002:a2e:a726:0:b0:2d2:9d40:f5ba with SMTP id s38-20020a2ea726000000b002d29d40f5bamr989870lje.20.1709042648986; Tue, 27 Feb 2024 06:04:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfQNDM6Wg5dNO/3YiSouJ9+JGerrZOA2fpBVrGxtJsREMiEfWLYbO/WqvXTyk5+T9mhsfP5w== X-Received: by 2002:a2e:a726:0:b0:2d2:9d40:f5ba with SMTP id s38-20020a2ea726000000b002d29d40f5bamr989850lje.20.1709042648625; Tue, 27 Feb 2024 06:04:08 -0800 (PST) X-Received: from [192.168.123.67] (ip-095-222-037-056.um34.pools.vodafone-ip.de. [95.222.37.56]) by smtp.gmail.com with ESMTPSA id j12-20020a05600c190c00b00412a5a24745sm5891202wmq.27.2024.02.27.06.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 06:04:07 -0800 (PST) Message-ID: Date: Tue, 27 Feb 2024 15:04:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c To: Chao Li Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen , Samer El-Haj-Mahmoud , Eric Jin , Arvin Chen , Supreeth Venkatesh , devel@edk2.groups.io References: <20240227063737.1675884-1-lichao@loongson.cn> From: "Heinrich Schuchardt" In-Reply-To: <20240227063737.1675884-1-lichao@loongson.cn> 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,heinrich.schuchardt@canonical.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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=hfjA3VwX; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=canonical.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 On 27.02.24 07:37, Chao Li wrote: > DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a > bug, code: >=20 > SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DEVICE_= PATH))); >=20 > 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. >=20 > Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct-Wincompatible-pointer-types= warnings") >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4712 >=20 > 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(-) >=20 > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromTex= t/BlackBoxTest/DevicePathFromTextBBTestCoverage.c b/uefi-sct/SctPkg/TestCas= e/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTes= tCoverage.c > index c96ee246..bd11c25a 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/Black= BoxTest/DevicePathFromTextBBTestCoverage.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/Black= BoxTest/DevicePathFromTextBBTestCoverage.c > @@ -1734,13 +1734,13 @@ CreateDNSDeviceNode ( > } > =20 > if (DNS->IsIPv6 =3D=3D 0) { > - SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DE= VICE_PATH))); > - SctStrToIPv4Addr (&IpStr2, (EFI_IPv4_ADDRESS *)(DNS + sizeof (DNS_DE= VICE_PATH) + sizeof(EFI_IP_ADDRESS))); > + SctStrToIPv4Addr (&IpStr1, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeo= f (DNS_DEVICE_PATH))); > + SctStrToIPv4Addr (&IpStr2, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeo= f (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); > } > =20 > if (DNS->IsIPv6 =3D=3D 1) { > - SctStrToIPv6Addr (&IpStr1, (EFI_IPv6_ADDRESS *)(DNS + sizeof (DNS_DE= VICE_PATH))); > - SctStrToIPv6Addr (&IpStr2, (EFI_IPv6_ADDRESS *)(DNS + sizeof (DNS_DE= VICE_PATH) + sizeof(EFI_IP_ADDRESS))); > + SctStrToIPv6Addr (&IpStr1, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeo= f (DNS_DEVICE_PATH))); > + SctStrToIPv6Addr (&IpStr2, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeo= f (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS))); > } > =20 > return (EFI_DEVICE_PATH_PROTOCOL *) DNS; Reviewed-by: Heinrich Schuchardt -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116044): https://edk2.groups.io/g/devel/message/116044 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-