summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-04-19 17:50:00 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-04-27 21:18:33 +0800
commit3337eefb49d9053cfd75028ab74dad0cd7acd045 (patch)
treebc32b76d70bba4071b6ee8ba6eeb4d7ceb545540 /BaseTools/Source
parent91048b0df658e47cef0ccdedc4b790e8a0f1035d (diff)
downloadedk2-3337eefb49d9053cfd75028ab74dad0cd7acd045.zip
edk2-3337eefb49d9053cfd75028ab74dad0cd7acd045.tar.gz
edk2-3337eefb49d9053cfd75028ab74dad0cd7acd045.tar.bz2
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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index eff5f9e..a695529 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;
}