From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119798938195.30638283613678; Wed, 26 Jul 2017 18:43:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E2BB32095DB95; Wed, 26 Jul 2017 18:41:13 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 6AA8B21D491B4 for ; Wed, 26 Jul 2017 18:41:12 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2017 18:43:12 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:11 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825185" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:27 +0800 Message-Id: <1501119752-3856-2-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 1/6] BaseTools/Split: Fix the segmentation fault in GetSplitValue() 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D538 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/Split/Split.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/Split/Split.c b/BaseTools/Source/C/Split/Sp= lit.c index 7ab66be..6b0a323 100644 --- a/BaseTools/Source/C/Split/Split.c +++ b/BaseTools/Source/C/Split/Split.c @@ -1,10 +1,10 @@ /** @file =20 Split a file into two pieces at the request offset. =20 -Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php =20 @@ -78,11 +78,11 @@ Returns: GC_TODO: add return values =20 --*/ { Version(); - printf ("Copyright (c) 1999-2016 Intel Corporation. All rights reserved.= \n"); + printf ("Copyright (c) 1999-2017 Intel Corporation. All rights reserved.= \n"); printf ("\n SplitFile creates two Binary files either in the same direc= tory as the current working\n"); printf (" directory or in the specified directory.\n"); printf ("\nUsage: \n\ Split\n\ -f, --filename inputFile to split\n\ @@ -101,17 +101,21 @@ EFI_STATUS GetSplitValue ( IN CONST CHAR8* SplitValueString, OUT UINT64 *ReturnValue ) { - UINT64 len =3D strlen(SplitValueString); + UINT64 len =3D 0; UINT64 base =3D 1; UINT64 index =3D 0; UINT64 number =3D 0; CHAR8 lastCHAR =3D 0; EFI_STATUS Status =3D EFI_SUCCESS; =20 + if (SplitValueString !=3D NULL){ + len =3D strlen(SplitValueString); + } + if (len =3D=3D 0) { return EFI_ABORTED; } =20 Status =3D AsciiStringToUint64 (SplitValueString, FALSE, ReturnValue); --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119811157497.5021787762622; Wed, 26 Jul 2017 18:43:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 313072095D9D7; Wed, 26 Jul 2017 18:41:26 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 694FD21D491B4 for ; Wed, 26 Jul 2017 18:41:25 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Jul 2017 18:43:28 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:27 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825228" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:28 +0800 Message-Id: <1501119752-3856-3-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 2/6] BaseTools/GenSec: Fix a segmentation fault in main() 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D537 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/GenSec/GenSec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec= /GenSec.c index 9129b50..c0e4de2 100644 --- a/BaseTools/Source/C/GenSec/GenSec.c +++ b/BaseTools/Source/C/GenSec/GenSec.c @@ -1,9 +1,9 @@ /** @file Creates output file that is a properly formed section per the PI spec. =20 -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 http://opensource.org/licenses/bsd-license.php = =20 = =20 @@ -144,11 +144,11 @@ Returns: fprintf (stdout, "\nUsage: %s [options] [input_file]\n\n", UTILITY_NAME); =20 // // Copyright declaration //=20 - fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All righ= ts reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All righ= ts reserved.\n\n"); =20 // // Details Option // fprintf (stdout, "Options:\n"); @@ -1118,10 +1118,14 @@ Returns: argv +=3D 2; continue; } =20 if ((stricmp (argv[0], "-r") =3D=3D 0) || (stricmp (argv[0], "--attrib= utes") =3D=3D 0)) { + if (argv[1] =3D=3D NULL) { + Error (NULL, 0, 1003, "Invalid option value", "Guid section attrib= utes can't be NULL"); + goto Finish; + } if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTION_PROC= ESSING_REQUIRED]) =3D=3D 0) { SectGuidAttribute |=3D EFI_GUIDED_SECTION_PROCESSING_REQUIRED; } else if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTI= ON_AUTH_STATUS_VALID]) =3D=3D 0) { SectGuidAttribute |=3D EFI_GUIDED_SECTION_AUTH_STATUS_VALID; } else if (stricmp (argv[1], mGUIDedSectionAttribue[0]) =3D=3D 0) { --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119814314269.7121890392456; Wed, 26 Jul 2017 18:43:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6A16A21D09185; Wed, 26 Jul 2017 18:41:29 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 D5CA021D09183 for ; Wed, 26 Jul 2017 18:41:27 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Jul 2017 18:43:31 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:30 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825249" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:29 +0800 Message-Id: <1501119752-3856-4-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 3/6] BaseTools/GenFfs: Fix a segmentation fault from vsprintf()/vfprintf() 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D536 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/GenFfs/GenFfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs= /GenFfs.c index 91632a9..eaef8a2 100644 --- a/BaseTools/Source/C/GenFfs/GenFfs.c +++ b/BaseTools/Source/C/GenFfs/GenFfs.c @@ -1,9 +1,9 @@ /** @file This file contains functions required to generate a Firmware File System f= ile. =20 -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 http://opensource.org/licenses/bsd-license.php = =20 = =20 @@ -114,11 +114,11 @@ Returns: fprintf (stdout, "\nUsage: %s [options]\n\n", UTILITY_NAME); =20 // // Copyright declaration //=20 - fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All righ= ts reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All righ= ts reserved.\n\n"); =20 // // Details Option // fprintf (stdout, "Options:\n"); @@ -734,11 +734,11 @@ Returns: argc -=3D 2; argv +=3D 2; continue; } =20 - Error (NULL, 0, 1000, "Unknown option", argv[0]); + Error (NULL, 0, 1000, "Unknown option", "%s", argv[0]); goto Finish; } =20 VerboseMsg ("%s tool start.", UTILITY_NAME); =20 --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119816537951.7257152482271; Wed, 26 Jul 2017 18:43:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AA45221D09184; Wed, 26 Jul 2017 18:41:31 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 211D921D491BF for ; Wed, 26 Jul 2017 18:41:30 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Jul 2017 18:43:33 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:32 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825260" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:30 +0800 Message-Id: <1501119752-3856-5-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 4/6] BaseTools/EfiRom: Fix a segmentation fault from vsprintf()/vfprintf() 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D534 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/EfiRom/EfiRom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom= /EfiRom.c index c58c152..84322e3 100644 --- a/BaseTools/Source/C/EfiRom/EfiRom.c +++ b/BaseTools/Source/C/EfiRom/EfiRom.c @@ -1,9 +1,9 @@ /** @file Utility program to create an EFI option ROM image from binary and EFI PE32= files. =20 -Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availabl= e=20 under the terms and conditions of the BSD License which accompanies this=20 distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php =20 @@ -240,11 +240,11 @@ Returns: =20 // // Try to open the input file // if ((InFptr =3D fopen (LongFilePath (InFile->FileName), "rb")) =3D=3D NU= LL) { - Error (NULL, 0, 0001, "Error opening file", InFile->FileName); + Error (NULL, 0, 0001, "Error opening file", "%s", InFile->FileName); return STATUS_ERROR; } // // Seek to the end of the input file and get the file size. Then allocate // a buffer to read it in to. @@ -1260,11 +1260,11 @@ Returns: fprintf (stdout, "Usage: %s -f VendorId -i DeviceId [options] [file name= ] \n\n", UTILITY_NAME); =20 // // Copyright declaration //=20 - fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All righ= ts reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All righ= ts reserved.\n\n"); =20 // // Details Option // fprintf (stdout, "Options:\n"); --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119819015119.92382613704774; Wed, 26 Jul 2017 18:43:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E263C21D09190; Wed, 26 Jul 2017 18:41:32 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 2C36D21D09189 for ; Wed, 26 Jul 2017 18:41:32 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Jul 2017 18:43:35 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:34 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825266" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:31 +0800 Message-Id: <1501119752-3856-6-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 5/6] BaseTools/EfiLdrImage: Fix a segmentation fault from vfprintf() 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D533 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c b/BaseTools/Sourc= e/C/EfiLdrImage/EfiLdrImage.c index a46ecf8..5368d22 100644 --- a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c +++ b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c @@ -4,11 +4,11 @@ This tool combines several PE Image files together using = following format denote FILE :=3D EFILDR_HEADER EFILDR_IMAGE + + The order of EFILDR_IMAGE is same as the order of placing PeImageFileConte= nt. =20 -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 http://opensource.org/licenses/bsd-license.php = =20 =20 @@ -82,11 +82,11 @@ Usage ( VOID ) { printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ..= . PeImageN\n"); printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSI= ON, UTILITY_MINOR_VERSION, __BUILD_VERSION); - printf ("Copyright (c) 1999-2016 Intel Corporation. All rights reserved.= \n"); + printf ("Copyright (c) 1999-2017 Intel Corporation. All rights reserved.= \n"); printf ("\n The EfiLdrImage tool is used to combine PE files into EFILD= R image with Efi loader header.\n"); } =20 EFI_STATUS CountVerboseLevel ( @@ -219,11 +219,11 @@ Returns: if ((strlen(argv[0]) >=3D 2 && argv[0][0] =3D=3D '-' && (argv[0][1] = =3D=3D 'v' || argv[0][1] =3D=3D 'V')) || (stricmp (argv[0], "--verbose") = =3D=3D 0)) { VerboseLevel =3D 1; if (strlen(argv[0]) > 2) { Status =3D CountVerboseLevel (&argv[0][2], strlen(argv[0]) - 2, &V= erboseLevel); if (EFI_ERROR (Status)) { - Error (NULL, 0, 1003, "Invalid option value", argv[0]); + Error (NULL, 0, 1003, "Invalid option value", "%s", argv[0]); return STATUS_ERROR; =20 } } =20 argc --; --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Dec 27 01:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501119822152842.9588920623256; Wed, 26 Jul 2017 18:43:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 29B6621D09197; Wed, 26 Jul 2017 18:41:35 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 2839F21D491BF for ; Wed, 26 Jul 2017 18:41:34 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Jul 2017 18:43:37 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 26 Jul 2017 18:43:36 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,417,1496127600"; d="scan'208";a="1155825271" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 09:42:32 +0800 Message-Id: <1501119752-3856-7-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> References: <1501119752-3856-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch 6/6] BaseTools/GenCrc32: Fix a bug to hand empty file for decode 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: , Cc: chenbo@pdx.edu, Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D535 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/GenCrc32/GenCrc32.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenCrc32/GenCrc32.c b/BaseTools/Source/C/Ge= nCrc32/GenCrc32.c index e1e11c6..5153587 100644 --- a/BaseTools/Source/C/GenCrc32/GenCrc32.c +++ b/BaseTools/Source/C/GenCrc32/GenCrc32.c @@ -1,9 +1,9 @@ /** @file Calculate Crc32 value and Verify Crc32 value for input data. =20 -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 http://opensource.org/licenses/bsd-license.php = =20 = =20 @@ -78,11 +78,11 @@ Returns: fprintf (stdout, "Usage: GenCrc32 -e|-d [options] \n\n"); =20 // // Copyright declaration //=20 - fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All righ= ts reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All righ= ts reserved.\n\n"); =20 // // Details Option // fprintf (stdout, "optional arguments:\n"); @@ -324,10 +324,14 @@ Returns: VerboseMsg ("the size of the encoded file is %u bytes", (unsigned) Fil= eSize + sizeof (UINT32)); } else { // // Verify Crc32 Value // + if (FileSize < sizeof (UINT32)) { + Error (NULL, 0, 3000, "Invalid", "Input file is invalid!"); + goto Finish; + } Status =3D CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - si= zeof (UINT32), &Crc32Value); if (Status !=3D EFI_SUCCESS) { Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!"); goto Finish; } --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel