From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.3610.1571061855812909838 for ; Mon, 14 Oct 2019 07:04:16 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 07:04:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,295,1566889200"; d="scan'208";a="225086816" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 14 Oct 2019 07:04:14 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 07:04:14 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 07:04:14 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.119]) by SHSMSX151.ccr.corp.intel.com ([10.239.6.50]) with mapi id 14.03.0439.000; Mon, 14 Oct 2019 22:04:12 +0800 From: "Zhang, Shenglei" To: =?utf-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= , "devel@edk2.groups.io" , "Gao, Zhichao" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: Add check for MemFile->Buffer Thread-Topic: [edk2-devel] [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: Add check for MemFile->Buffer Thread-Index: AQHVgi47NWEt91wsoU6mUPbAJITIhqdZrPgQ//+u9ACAAM/sIA== Date: Mon, 14 Oct 2019 14:04:11 +0000 Message-ID: References: <20191014012511.860-1-shenglei.zhang@intel.com> <3CE959C139B4C44DBEA1810E3AA6F9000B8565FD@SHSMSX101.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogUGhpbGlwcGUgTWF0aGll dS1EYXVkw6kgW21haWx0bzpwaGlsbWRAcmVkaGF0LmNvbV0NCj4gU2VudDogTW9uZGF5LCBPY3Rv YmVyIDE0LCAyMDE5IDU6MzkgUE0NCj4gVG86IGRldmVsQGVkazIuZ3JvdXBzLmlvOyBHYW8sIFpo aWNoYW8gPHpoaWNoYW8uZ2FvQGludGVsLmNvbT47IFpoYW5nLA0KPiBTaGVuZ2xlaSA8c2hlbmds ZWkuemhhbmdAaW50ZWwuY29tPg0KPiBDYzogTmksIFJheSA8cmF5Lm5pQGludGVsLmNvbT4NCj4g U3ViamVjdDogUmU6IFtlZGsyLWRldmVsXSBbUEFUQ0ggdjJdIFNoZWxsUGtnL1NoZWxsL0ZpbGVI YW5kbGVXcmFwcGVycy5jOg0KPiBBZGQgY2hlY2sgZm9yIE1lbUZpbGUtPkJ1ZmZlcg0KPiANCj4g T24gMTAvMTQvMTkgODozNSBBTSwgR2FvLCBaaGljaGFvIHdyb3RlOg0KPiA+IFJlZmVyIHRvIENT UyA1LjIuMi42IEFsd2F5cyBwdXQgc3BhY2UgYmVmb3JlIGFuIG9wZW4gcGFyZW50aGVzaXMuDQo+ ID4gRnJlZVBvb2woQXNjaWlCdWZmZXIpOyBzaG91bGQgYmUgRnJlZVBvb2wgKEFzY2lpQnVmZmVy KTsNCj4gPiBBZnRlciBh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