From 8830bfb5588c4de2859f61b9a90efb2ff8dfe30b Mon Sep 17 00:00:00 2001 From: Dimitry Sibiryakov Date: Sat, 11 Jun 2016 18:35:17 +0200 Subject: [PATCH] Postfix for #24 that fixes CORE-5271 --- src/common/os/posix/path_utils.cpp | 6 ++++++ src/common/os/win32/path_utils.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/common/os/posix/path_utils.cpp b/src/common/os/posix/path_utils.cpp index 06b047bd296..596aa0d6fa8 100644 --- a/src/common/os/posix/path_utils.cpp +++ b/src/common/os/posix/path_utils.cpp @@ -136,6 +136,12 @@ void PathUtils::concatPath(Firebird::PathName& result, const Firebird::PathName& first, const Firebird::PathName& second) { + if (first.length() == 0) + { + result = second; + return; + } + result = first; // First path used to be from trusted sources like getRootDirectory, etc. diff --git a/src/common/os/win32/path_utils.cpp b/src/common/os/win32/path_utils.cpp index 3eff83b919e..ada6b59a6ff 100644 --- a/src/common/os/win32/path_utils.cpp +++ b/src/common/os/win32/path_utils.cpp @@ -108,6 +108,12 @@ void PathUtils::concatPath(Firebird::PathName& result, const Firebird::PathName& first, const Firebird::PathName& second) { + if (first.length() == 0) + { + result = second; + return; + } + result = first; // First path used to be from trusted sources like getRootDirectory, etc.