From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1383421A16ED8 for ; Thu, 18 May 2017 18:35:57 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2017 18:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,361,1491289200"; d="scan'208";a="263817867" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 18 May 2017 18:35:56 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 18 May 2017 18:35:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Fri, 19 May 2017 09:35:54 +0800 From: "Gao, Liming" To: Laszlo Ersek , Sergei Temerkhanov CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] MdePkg: Fix undefined behavior on variadic parameters Thread-Index: AQHSzfAyZrqQmCd2hkaaBmjkinJcnqH2aIWQ///wYICAAwWeAIABhaHQ Date: Fri, 19 May 2017 01:35:54 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D730AC8@shsmsx102.ccr.corp.intel.com> References: <1494903391-716-1-git-send-email-s.temerkhanov@gmail.com> <1494903391-716-2-git-send-email-s.temerkhanov@gmail.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14D72E8BC@shsmsx102.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 Subject: Re: [PATCH] MdePkg: Fix undefined behavior on variadic parameters X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 May 2017 01:35:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 TGFzemxvOg0KICBCYXNlZCBvbiB5b3VyIGFuYWx5c2lzLCB0aGUgcGFyYW1ldGVyIHR5cGUgc2hv dWxkIGJlIGNoYW5nZWQgZnJvbSBCT09MRUFOIHRvIElOVDMyIHRvIG1hdGNoIGl0cyBwcm9tb3Rp b24gdHlwZS4gUmlnaHQ/DQoNClRoYW5rcw0KTGltaW5nDQo+LS0tLS1PcmlnaW5hbCBNZXNzYWdl LS0tLS0NCj5Gcm9tOiBlZGsyLWRldmVsIFttYWlsdG86ZWRrMi1kZXZlbC1ib3VuY2VzQGxpc3Rz LjAxLm9yZ10gT24gQmVoYWxmIE9mDQo+TGFzemxvIEVyc2VrDQo+U2VudDogVGh1cnNkYXksIE1h eSAxOCwgMjAxNyA2OjIwIFBNDQo+VG86IFNlcmdlaSBUZW1lcmtoYW5vdiA8cy50ZW1lcmtoYW5v dkBnbWFpbC5jb20+OyBHYW8sIExpbWluZw0KPjxsaW1pbmcuZ2FvQGludGVsLmNvbT4NCj5DYzog ZWRrMi1kZXZlbEBsaXN0cy4wMS5vcmcNCj5TdWJqZWN0OiBSZTogW2VkazJdIFtQQVRDSF0gTWRl UGtnOiBGaXggdW5kZWZpbmVkIGJlaGF2aW9yIG9uIHZhcmlhZGljDQo+cGFyYW1ldGVycw0KPg0K Pk9uIDA1LzE2LzE3IDE0OjEwLCBTZXJnZWkgVGVtZXJraGFub3Ygd3JvdGU6DQo+PiBPbiBUdWUs IE1heSAxNiwgMjAxNyBhdCA4OjEwIEFNLCBHYW8sIExpbWluZyA8bGltaW5nLmdhb0BpbnR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