diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-30 19:33:03 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-30 19:33:03 +0000 |
commit | 33c031ee2092282a069ce07d30202082ceaf61fe (patch) | |
tree | af76c06a5c4f476e9dfe23096ff2bc0295beaee1 /ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c | |
parent | 6b825919f1c16b07b5cac7fc5e298fbeb530d888 (diff) | |
download | edk2-platforms-33c031ee2092282a069ce07d30202082ceaf61fe.tar.xz |
pointer verification (not NULL) and buffer overrun fixes.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11459 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c index 115013a1e3..780b39e2fd 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c @@ -124,7 +124,7 @@ CheckAndSetDate ( if (Walker1 != NULL) {
Walker = Walker1 + 1;
}
- Walker1 = StrStr(Walker, L"/");
+ Walker1 = Walker!=NULL?StrStr(Walker, L"/"):NULL;
if (Walker1 != NULL && *Walker1 == L'/') {
*Walker1 = CHAR_NULL;
}
@@ -133,7 +133,7 @@ CheckAndSetDate ( if (Walker1 != NULL) {
Walker = Walker1 + 1;
}
- Walker1 = StrStr(Walker, L"/");
+ Walker1 = Walker!=NULL?StrStr(Walker, L"/"):NULL;
if (Walker1 != NULL && *Walker1 == L'/') {
*Walker1 = CHAR_NULL;
}
@@ -312,7 +312,7 @@ CheckAndSetTime ( TheTime.Hour = 0xFF;
TheTime.Minute = 0xFF;
- Walker2 = StrStr(Walker1, L":");
+ Walker2 = Walker1!=NULL?StrStr(Walker1, L":"):NULL;
if (Walker2 != NULL && *Walker2 == L':') {
*Walker2 = CHAR_NULL;
}
@@ -320,7 +320,7 @@ CheckAndSetTime ( if (Walker2 != NULL) {
Walker1 = Walker2 + 1;
}
- Walker2 = StrStr(Walker1, L":");
+ Walker2 = Walker1!=NULL?StrStr(Walker1, L":"):NULL;
if (Walker2 != NULL && *Walker2 == L':') {
*Walker2 = CHAR_NULL;
}
|