From nobody Sun May 12 19:55:23 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+107130+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+107130+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1689954487; cv=none; d=zohomail.com; s=zohoarc; b=kd2RxHh/fOIMNR2am65XbVUQxgIrVsXb0BJk+MjkHRPbQneNUjHeoh20JAaWfNO2qnXUKGS6z9XDlHFN6XFh7oNX/kZj/TcbfpV6BilAkqJKZ6h50Ctd5CRkIOqaFdloD70jHk+H7rZ9OU/PUKgol/G2DsP0VbyABlziQ97n06M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689954487; 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=UEpTtyhO92oeFDBi0U6i8NP3Z8kz3xcNHp3V4sFNXsM=; b=neGG1kwOm2V0eNzGiuRVy1IGGF7RvxBbp7DWKIjE1l2zYx5xqLuBovo9wvjwzChr9l65xwavTLJ/8R1usEmnd96/qxGOVEQf0w9oOvgAeFRgrd5j1owWhIz8rWjhUxkhZ8YQfMf7cbNC4HW4XS+N6t1yEGDpCllqRNik5BHtKtQ= 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+107130+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 1689954487371571.0213348289444; Fri, 21 Jul 2023 08:48:07 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=gUHocxrjvxSaM5DrC+JFJlcpivcuDvLKZoksrlXxl4Q=; 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-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=1689954485; v=1; b=TKwAibMMddz/oVPJBk4Q9+eNIXXYyhY2IFK2TH5FyHaWVk3EixzqDm5gD9b5DZRcYUilMBps XCKWWFYf0E3dXYgYYy9VFq+I1050GDPIs2CEQ48KwapXkE0URJC2obs5tqsAZYwZrsyrBO7SiLa 8m5/RNbm/d0MhA/U3QpABdKQ= X-Received: by 127.0.0.2 with SMTP id IkX2YY1788612xuM8vsmEV5R; Fri, 21 Jul 2023 08:48:05 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.10490.1689954481643648028 for ; Fri, 21 Jul 2023 08:48:05 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="357043433" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="357043433" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 08:48:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="868275252" X-Received: from njayapra-mobl.gar.corp.intel.com ([10.213.73.65]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 08:48:03 -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 v2 1/1] edk2-libc/StdLib: Uninitialized global variable Date: Fri, 21 Jul 2023 21:17:52 +0530 Message-Id: <20230721154752.1871-2-n.jayaprakash@intel.com> In-Reply-To: <20230721154752.1871-1-n.jayaprakash@intel.com> References: <20230721154752.1871-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: rQIfR7gG73HwVEvrwtOA35Ocx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689954487950100001 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 in= itialized. 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 Co-authored-by: Kloper Dimitry Signed-off-by: Jayaprakash N --- StdLib/BsdSocketLib/res_init.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/StdLib/BsdSocketLib/res_init.c b/StdLib/BsdSocketLib/res_init.c index 613a76a..6421d9a 100644 --- a/StdLib/BsdSocketLib/res_init.c +++ b/StdLib/BsdSocketLib/res_init.c @@ -122,9 +122,10 @@ static u_int32_t net_mask __P((struct in_addr)); =20 struct __res_state _res # if defined(__BIND_RES_TEXT) - =3D { RES_TIMEOUT, } /* Motorola, et al. */ -# endif - ; + =3D { RES_TIMEOUT, }; /* Motorola, et al. */ +#else + =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 (#107130): https://edk2.groups.io/g/devel/message/107130 Mute This Topic: https://groups.io/mt/100279095/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-