diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-04-19 17:50:00 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:29 +0800 |
commit | 2a3efa5c4e02ad7e3a2d81191a1bd95a2ad11fd5 (patch) | |
tree | be3b06d34906c70f00638a2d954c11e47f83204f /BaseTools/Source | |
parent | 8bd8d78365537885ee7353b3e9b83f7ecaef0af7 (diff) | |
download | edk2-platforms-2a3efa5c4e02ad7e3a2d81191a1bd95a2ad11fd5.tar.xz |
BaseTools/VolInfo: Update OPENSSL_PATH to support space characters
Update OPENSSL_PATH handling to support space characters in the Path.
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/VolInfo/VolInfo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c index eff5f9ebfc..a695529b8a 100644 --- a/BaseTools/Source/C/VolInfo/VolInfo.c +++ b/BaseTools/Source/C/VolInfo/VolInfo.c @@ -331,7 +331,10 @@ Returns: if (OpenSslEnv == NULL) {
OpenSslPath = OpenSslCommand;
} else {
- OpenSslPath = malloc(strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);
+ //
+ // We add quotes to the Openssl Path in case it has space characters
+ //
+ OpenSslPath = malloc(2+strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);
if (OpenSslPath == NULL) {
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
return GetUtilityStatus ();
@@ -1591,11 +1594,12 @@ CombinePath ( {
UINT32 DefaultPathLen;
UINT64 Index;
-
+ CHAR8 QuotesStr[] = "\"";
+ strcpy(NewPath, QuotesStr);
DefaultPathLen = strlen(DefaultPath);
- strcpy(NewPath, DefaultPath);
+ strcat(NewPath, DefaultPath);
Index = 0;
- for (; Index < DefaultPathLen; Index ++) {
+ for (; Index < DefaultPathLen + 1; Index ++) {
if (NewPath[Index] == '\\' || NewPath[Index] == '/') {
if (NewPath[Index + 1] != '\0') {
NewPath[Index] = '/';
@@ -1607,6 +1611,7 @@ CombinePath ( NewPath[Index + 1] = '\0';
}
strcat(NewPath, AppendPath);
+ strcat(NewPath, QuotesStr);
return EFI_SUCCESS;
}
|