From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.45741.1658262521065501756 for ; Tue, 19 Jul 2022 13:28:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WfpTt3N3; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: miki.shindo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658262521; x=1689798521; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DcWHTBV/kbL2Xhy547V0oSArACpaxKwKuUBWzuayO9w=; b=WfpTt3N3r1mfzyn/wu8Rg8D7TmG87SBc7vDigs2QRqDl1Wz0dsWmvS7v 5rTZQJV5jj0x4kReCWTnWKi1T5znsXSVqzcqQlCLqfGooFgJFUklGBsn6 FEgJ0oRAQeQlru8hJAD+1a8+uY0SxizRGY5PaUhqNJVpBAG94nJyawMzb K4RajW5VABLSP0NYG0WIbA+C8VNRpdbtwxk0XI8fUhr1R/No2aHma6bnI TWZvqOTL7hw3XsUOHjIyRqkxdaotqg7HebcQD7P3rcEK1G/MEBRQfUgdg 1+64IVfGoroczG8O7kMUr1QezxONgroKZEZquTNFOclo3ZSTmhjhbwCEo g==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="348286340" X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="348286340" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 13:28:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="774253425" Received: from mshindo-desk2.amr.corp.intel.com ([10.53.88.126]) by orsmga005.jf.intel.com with ESMTP; 19 Jul 2022 13:28:40 -0700 From: "Miki Shindo" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni Subject: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation Date: Tue, 19 Jul 2022 13:28:26 -0700 Message-Id: <20220719202826.18300-1-miki.shindo@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4001 This commit adds NULL check on memory allocation of the size for FileName in ASCII string format at PosixFileSetInfo(). Signed-off-by: Miki Shindo Cc: Andrew Fish Cc: Ray Ni --- EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c b/EmulatorPkg/Unix/Hos= t/PosixFileSystem.c index ae3fe72a05..b69d3d5520 100644 --- a/EmulatorPkg/Unix/Host/PosixFileSystem.c +++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c @@ -1187,7 +1187,7 @@ PosixFileSetInfo ( }=0D =0D OldFileName =3D malloc (AsciiStrSize (PrivateFile->FileName));=0D - if (OldFileInfo =3D=3D NULL) {=0D + if (OldFileName =3D=3D NULL) {=0D goto Done;=0D }=0D =0D --=20 2.27.0.windows.1