From 8e9a985f0b7ec282b2336465e10334513444a264 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 18 Oct 2023 21:11:10 +0100 Subject: [PATCH] Remove unnecessary and dangerous path string parsing --- cpp/src/arrow/filesystem/azurefs.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index ea6dd121b0fdb..ec27318c4c07c 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -78,9 +78,7 @@ struct AzurePath { "Expected an Azure object path of the form 'container/path...', got a URI: '", s, "'"); } - auto src = internal::RemoveTrailingSlash(s); - auto input_path = std::string(src.data()); - src = internal::RemoveLeadingSlash(src); + const auto src = internal::RemoveTrailingSlash(s); auto first_sep = src.find_first_of(internal::kSep); if (first_sep == 0) { return Status::Invalid("Path cannot start with a separator ('", s, "')");