Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[thirdparty](patch) Fix brpc (1.4.0) security issue CVE-2023-31039 #44066

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions thirdparty/patches/brpc-1.5.0-remove-wordexp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/src/brpc/server.cpp b/src/brpc/server.cpp
index 380ebb20d4..b4758ad8c8 100644
--- a/src/brpc/server.cpp
+++ b/src/brpc/server.cpp
@@ -16,7 +16,6 @@
// under the License.


-#include <wordexp.h> // wordexp
#include <iomanip>
#include <arpa/inet.h> // inet_aton
#include <fcntl.h> // O_CREAT
@@ -1716,23 +1715,7 @@ void Server::GenerateVersionIfNeeded() {
}
}

-static std::string ExpandPath(const std::string &path) {
- if (path.empty()) {
- return std::string();
- }
- std::string ret;
- wordexp_t p;
- wordexp(path.c_str(), &p, 0);
- CHECK_EQ(p.we_wordc, 1u);
- if (p.we_wordc == 1) {
- ret = p.we_wordv[0];
- }
- wordfree(&p);
- return ret;
-}
-
void Server::PutPidFileIfNeeded() {
- _options.pid_file = ExpandPath(_options.pid_file);
if (_options.pid_file.empty()) {
return;
}
Loading