Fix RPC/SCGI security and crash bugs by @sirus20x6

This commit is contained in:
Jari Sundell
2026-05-26 10:27:10 +02:00
committed by GitHub
parent a5ecd89a54
commit 64881317c6
7 changed files with 54 additions and 24 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ SCgi::open_port(sockaddr* sa, unsigned int length, bool dont_route) {
void
SCgi::open_named(const std::string& filename) {
if (filename.empty() || filename.size() > 4096)
if (filename.empty() || filename.size() >= sizeof(sockaddr_un::sun_path))
throw torrent::resource_error("Invalid filename length.");
auto buffer = std::make_unique<char[]>(sizeof(sockaddr_un) + filename.size() + 1);