Validate control packet size

Summary: resolves T13332

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Maniphest Tasks: T13332

Differential Revision: https://repo.mireo.local/D27000
This commit is contained in:
Korina Šimičević
2023-12-22 09:17:45 +01:00
parent 79d3f7606d
commit 97d8a4ea86
16 changed files with 259 additions and 207 deletions

View File

@@ -56,6 +56,9 @@ enum class error : int {
/** The packet is malformed. */
malformed_packet = 100,
/** The packet has exceeded the Maximum Packet Size the Server is willing to accept. */
packet_too_large,
/** The Client's session does not exist or it has expired. */
session_expired,
@@ -91,6 +94,9 @@ inline std::string client_error_to_string(error err) {
switch (err) {
case error::malformed_packet:
return "The packet is malformed.";
case error::packet_too_large:
return "The packet has exceeded the Maximum Packet Size "
"the Server is willing to accept.";
case error::session_expired:
return "The Client's session does not exist or it has expired.";
case error::pid_overrun: