]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VolInfo/VolInfo.c
BaseTools/VolInfo: Update OPENSSL_PATH to support space characters
[mirror_edk2.git] / BaseTools / Source / C / VolInfo / VolInfo.c
index 2647cbb73a176c04b605f52ab661df272fa29438..a695529b8a32a82136c39002f896ba976aba75df 100644 (file)
@@ -331,7 +331,10 @@ Returns:
       if (OpenSslEnv == NULL) {\r
         OpenSslPath = OpenSslCommand;\r
       } else {\r
-        OpenSslPath = malloc(strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);\r
+        //\r
+        // We add quotes to the Openssl Path in case it has space characters\r
+        //\r
+        OpenSslPath = malloc(2+strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);\r
         if (OpenSslPath == NULL) {\r
           Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");\r
           return GetUtilityStatus ();\r
@@ -1590,10 +1593,13 @@ CombinePath (
 )\r
 {\r
   UINT32 DefaultPathLen;\r
+  UINT64 Index;\r
+  CHAR8  QuotesStr[] = "\"";\r
+  strcpy(NewPath, QuotesStr);\r
   DefaultPathLen = strlen(DefaultPath);\r
-  strcpy(NewPath, DefaultPath);\r
-  UINT64 Index = 0;\r
-  for (; Index < DefaultPathLen; Index ++) {\r
+  strcat(NewPath, DefaultPath);\r
+  Index = 0;\r
+  for (; Index < DefaultPathLen + 1; Index ++) {\r
     if (NewPath[Index] == '\\' || NewPath[Index] == '/') {\r
       if (NewPath[Index + 1] != '\0') {\r
         NewPath[Index] = '/';\r
@@ -1605,6 +1611,7 @@ CombinePath (
     NewPath[Index + 1] = '\0';\r
   }\r
   strcat(NewPath, AppendPath);\r
+  strcat(NewPath, QuotesStr);\r
   return EFI_SUCCESS;\r
 }\r
 \r