mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-17 23:52:30 +00:00
Fix RPC/SCGI security and crash bugs by @sirus20x6
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user