From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.6742.1663851217942141485 for ; Thu, 22 Sep 2022 05:53:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=n9FS9DM/; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yi1.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663851217; x=1695387217; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0OgrvIg3yiIuKThLZnPKIU/ffzy5yGPF9ltyNF1D75E=; b=n9FS9DM/cvYs4lc+ACUWudpJREz9g3N/yeG7n4nuCs9x1ngmBrLH8eAB gw7XymrmknA0x7SY1daRQCJJXFffTOhWaPI8Frq5afbGiv4IafNB3dp51 eS4GdImfKXnRDwQhxqm6rfjjXrsw9xxMdhXuoNdvc1k7A8ZL1ECm+4Ibv pFN2dMWsk5aeTN8cpcJ3DQKamziqXJip9jxMkM+hzZ2SuyHqGishKoi8h X1wH4RGV4N0cGwIMZL7ypc9LqDOaATgnw0Tyo6aGFpE9f7XQ3ZscT+Hey eo80GnCxTTdYGsVDhtUL5rWkwagiTFUBNMOANkK943yGmDDSF5sQp9Lsx w==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="300270713" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="300270713" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 05:53:37 -0700 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="652955259" Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.82]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 05:53:35 -0700 From: "yi1 li" To: devel@edk2.groups.io Cc: Yi Li , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang Subject: [PATCH 1/1] CryptoPkg: Fix pem heap-buffer-overflow due to BIO_snprintf() Date: Thu, 22 Sep 2022 20:53:23 +0800 Message-Id: <16e7b6ba994118a47fd85d4fa7fa51aa42514b83.1663837631.git.yi1.li@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4075 Fake BIO_snprintf() need to return error status -1. 0 will be considered a correct return value, this may cause crash, please refer to bugzilla link for details. Signed-off-by: Yi Li Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang --- CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c index c1fc33538f..d7d8c206ed 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -494,7 +494,7 @@ BIO_snprintf ( ... ) { - return 0; + return -1; } #ifdef __GNUC__ -- 2.31.1.windows.1