BaseTools/Split: Fix the segmentation fault in GetSplitValue()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=538
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>
This commit is contained in:
Yonghong Zhu 2017-07-19 10:53:06 +08:00
parent c65df5d9a1
commit 15face06f4
1 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,7 @@
Split a file into two pieces at the request offset.
Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 1999 - 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
@ -80,7 +80,7 @@ Returns:
--*/
{
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 directory as the current working\n");
printf (" directory or in the specified directory.\n");
printf ("\nUsage: \n\
@ -103,13 +103,17 @@ GetSplitValue (
OUT UINT64 *ReturnValue
)
{
UINT64 len = strlen(SplitValueString);
UINT64 len = 0;
UINT64 base = 1;
UINT64 index = 0;
UINT64 number = 0;
CHAR8 lastCHAR = 0;
EFI_STATUS Status = EFI_SUCCESS;
if (SplitValueString != NULL){
len = strlen(SplitValueString);
}
if (len == 0) {
return EFI_ABORTED;
}