summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-07-19 10:54:39 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-08-01 10:50:24 +0800
commit67f3d09924b0fedf36833d11e599c609d319d0ea (patch)
tree8d3b722bcd033f8852230d8051a377864518ff7d /BaseTools/Source
parent15face06f400283e227aa814bf3180ccd19328a3 (diff)
downloadedk2-67f3d09924b0fedf36833d11e599c609d319d0ea.tar.gz
edk2-67f3d09924b0fedf36833d11e599c609d319d0ea.tar.bz2
edk2-67f3d09924b0fedf36833d11e599c609d319d0ea.zip
BaseTools/GenSec: Fix a segmentation fault in main()
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=537 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/C/GenSec/GenSec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index 9129b5067e..c0e4de254b 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1,7 +1,7 @@
/** @file
Creates output file that is a properly formed section per the PI spec.
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
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
@@ -146,7 +146,7 @@ Returns:
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
@@ -1120,6 +1120,10 @@ Returns:
}
if ((stricmp (argv[0], "-r") == 0) || (stricmp (argv[0], "--attributes") == 0)) {
+ if (argv[1] == NULL) {
+ Error (NULL, 0, 1003, "Invalid option value", "Guid section attributes can't be NULL");
+ goto Finish;
+ }
if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTION_PROCESSING_REQUIRED]) == 0) {
SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
} else if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTION_AUTH_STATUS_VALID]) == 0) {