From nobody Wed May 1 07:06:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78900+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78900+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=posteo.de ARC-Seal: i=1; a=rsa-sha256; t=1628451645; cv=none; d=zohomail.com; s=zohoarc; b=VlAlifjP1P0Tp8p6xsg2ktf3cTU/9mMvB+svHdam3iaa/UauFMXGydsqz5e5CieB7Z0BS5U2EU3hkrv5RpbrraSPnsiTjDApHYMZpNgoGO7Ey0BNZkUGTxGqLOgbjlK8N5usO5jc4DhbbjfpaJFveKaAZ3HjsMa7ePVGNm73d+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628451645; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4bQRYFJQOVqPw0fl7ToW2S3brOF+yinHYgYeP9Zwvok=; b=YPY5hn3+nncjHh7kSVX/C4moD0H7w0Oxwcx4fMeS62D8KbgeDg2KOadFYsDRZm4p0HseLbG3EcVqRY4kI6vVKjAVZzUuRqtM0uObMPF0P7FN2xAfdSPLdfHHMAm8iRKhjQs1ekdRB8g9aGfppWchtLv4FEuehh5Sza2QNzYrhZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78900+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162845164534937.50895619930429; Sun, 8 Aug 2021 12:40:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2UOdYY1788612xIZ3WRzvox4; Sun, 08 Aug 2021 12:40:45 -0700 X-Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web09.13703.1628451644103288274 for ; Sun, 08 Aug 2021 12:40:44 -0700 X-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 424B7240104 for ; Sun, 8 Aug 2021 21:40:42 +0200 (CEST) X-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GjV1j40t8z6tm6; Sun, 8 Aug 2021 21:40:41 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Abner Chang , Daniel Schaefer , Vitaly Cheptsov Subject: [edk2-devel] [PATCH] EmbeddedPkg/GdbStub: Check DebugImageInfoTable type safely Date: Sun, 8 Aug 2021 19:39:58 +0000 Message-Id: <42cbdbb34573448bff594229f93ae99d8d792db0.1628443860.git.mhaeuser@posteo.de> In-Reply-To: <88816e99692b15cf61f3057ffab4d54455159c7c.1628443860.git.mhaeuser@posteo.de> References: <88816e99692b15cf61f3057ffab4d54455159c7c.1628443860.git.mhaeuser@posteo.de> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mhaeuser@posteo.de X-Gm-Message-State: VAq2wMdi0apd9JoywXxVYSyzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628451645; bh=HUobu29v0JTMUsCndKVBsmMeNLtGBQOBlKobRnO7G7Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=CoFFSWgAe2dEYFfbwKgyX459IJTzs3HtXExqLqnBGFa32Y/gcTSbtTNJ2xoXICKezIs v3N0LNrpYxu+ehqa6oECgvfhh6yDsdP9//JydxicQSbOUMyqdy5rbi/uyPDj9z1F4StAb usdTdg12eGEDvJuhdq81XmAWrUyJ0GCryik= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628451646027100089 Content-Type: text/plain; charset="utf-8" C does not allow casting to or dereferencing incompatible pointer types. Use the ImageInfoType member of the union first to determine the data type before dereferencing NormalImage. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Abner Chang Cc: Daniel Schaefer Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- EmbeddedPkg/GdbStub/GdbStub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EmbeddedPkg/GdbStub/GdbStub.c b/EmbeddedPkg/GdbStub/GdbStub.c index 7f2a5ed20011..09167fdafb4d 100644 --- a/EmbeddedPkg/GdbStub/GdbStub.c +++ b/EmbeddedPkg/GdbStub/GdbStub.c @@ -1043,8 +1043,8 @@ QxferLibrary ( =20 if (gDebugTable !=3D NULL) { for (; gEfiDebugImageTableEntry < gDebugImageTableHeader->TableSize; g= EfiDebugImageTableEntry++, gDebugTable++) { - if (gDebugTable->NormalImage !=3D NULL) { - if ((gDebugTable->NormalImage->ImageInfoType =3D=3D EFI_DEBUG_IMAG= E_INFO_TYPE_NORMAL) && + if (gDebugTable->ImageInfoType !=3D NULL) { + if ((*gDebugTable->ImageInfoType =3D=3D EFI_DEBUG_IMAGE_INFO_TYPE_= NORMAL) && (gDebugTable->NormalImage->LoadedImageProtocolInstance !=3D NU= LL)) { Pdb =3D PeCoffLoaderGetDebuggerInfo ( gDebugTable->NormalImage->LoadedImageProtocolInstance->Im= ageBase, --=20 2.31.1 -=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 (#78900): https://edk2.groups.io/g/devel/message/78900 Mute This Topic: https://groups.io/mt/84754075/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-