From nobody Fri May 17 23:57:49 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+107252+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+107252+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690301315; cv=none; d=zohomail.com; s=zohoarc; b=kwvqRZsQ+HpmuRjR2WYF8k9bhyp5MKMy7CrAlHak6ADkPMxIeLwbBqxwXXHlACukdiY6T0eZmJgQf3wGllpXNG4nNkADaBvmvkshCoiZEBsZsOinIMkLEvG5KHd1HckmbHZp6Q8UFG+6H/VlBAZpYfSWtVSD35M4rQsmNKkHLUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690301315; h=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=1w/wAFVRZh3ru+Yxtnxiaw84atzNBDfD3vAZJBbGlUI=; b=NjGBtaTqIU3bg2v9o/WnIjWIa5uPSj3xAkRoEKkquGnwbnoaudR0V38sno6r+v4PhILdBWtecivWjdxmjNerV6jCiXqkFDIlZ7odbB4L4LQDSDoG4kG8TtUrctab9QVeDrO3+06sOH6qlAEIjFaSlRZYTq2p+F9ZOZXfXF1P61k= 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+107252+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 1690301315015191.85293782074461; Tue, 25 Jul 2023 09:08:35 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=MkNqCWtQ7Ov8LTyHtYBhxElS9qElQ7J5BRUF8AirsPg=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received: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:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1690301314; v=1; b=VmM+AXoBpIgTI98xZRJJbt9MFHJn71yGOYrX5G0q78qhL6zAKGzg3AJk7qUzCOBGsd9DwFIL NG30r69v44GEMmCT9fLk0IM3F/uthX6IjqZKdHRX5zi9a3Jih9rGoXW9SEuK/L1NBYSqSoJwVXT 5/mvt9IGk41B3ODOlaAcYThg= X-Received: by 127.0.0.2 with SMTP id h8d5YY1788612xPVTOfLRtwQ; Tue, 25 Jul 2023 09:08:34 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.24411.1690301311691072354 for ; Tue, 25 Jul 2023 09:08:34 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="434027281" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="434027281" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 09:08:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="761261981" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="761261981" X-Received: from njayapra-mobl.gar.corp.intel.com ([10.215.120.243]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 09:08:08 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Jayaprakash N , Rebecca Cran , Michael D Kinney , Kloper Dimitry Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix uninitialized global variable Date: Tue, 25 Jul 2023 21:37:56 +0530 Message-Id: <20230725160756.1869-2-n.jayaprakash@intel.com> In-Reply-To: <20230725160756.1869-1-n.jayaprakash@intel.com> References: <20230725160756.1869-1-n.jayaprakash@intel.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,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oocRdkpoHE49u41v8oFBaemlx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690301316701100007 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4506 res_init() is called from different places in sockets library. It depends on global _res variable containing a state. The problem is that if __BIND_RES_TEXT macro is not defined, _res is not initialized. Depending on compiler and build optimization this can fill the variable with garbage that is later used by res_init(). Fix is trivial - explicitly initialize _res. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Kloper Dimitry --- StdLib/BsdSocketLib/res_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/StdLib/BsdSocketLib/res_init.c b/StdLib/BsdSocketLib/res_init.c index 613a76a..faf2b5e 100644 --- a/StdLib/BsdSocketLib/res_init.c +++ b/StdLib/BsdSocketLib/res_init.c @@ -121,9 +121,11 @@ static u_int32_t net_mask __P((struct in_addr)); */ =20 struct __res_state _res -# if defined(__BIND_RES_TEXT) +#if defined(__BIND_RES_TEXT) =3D { RES_TIMEOUT, } /* Motorola, et al. */ -# endif +#endif + =3D {0} +#endif ; =20 =20 --=20 2.40.0.windows.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 (#107252): https://edk2.groups.io/g/devel/message/107252 Mute This Topic: https://groups.io/mt/100353380/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-