From 6705ef8dad38b76ac60eae0ca03634681c51da92 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <nilsson@opera.com> Date: Tue, 31 Mar 2015 05:52:32 +0200 Subject: [PATCH] Size check was broken and didn't return an alert properly (though would break later as no data was added). --- lib/modules/SSL.pmod/Packet.pike | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/modules/SSL.pmod/Packet.pike b/lib/modules/SSL.pmod/Packet.pike index 34f4eeda5e..6eaf085ed0 100644 --- a/lib/modules/SSL.pmod/Packet.pike +++ b/lib/modules/SSL.pmod/Packet.pike @@ -36,24 +36,25 @@ protected void create(ProtocolVersion version, void|int extra) protected object check_size(string data, int extra) { if (sizeof(data) > (PACKET_MAX_SIZE + extra)) - return Alert(ALERT_fatal, ALERT_unexpected_message, version); + return Alert(ALERT_fatal, ALERT_record_overflow, version); marginal_size = extra; fragment = data; + return 0; } object set_plaintext(string data) { - check_size(data, 0); + return check_size(data, 0); } object set_compressed(string data) { - check_size(data, 1024); + return check_size(data, 1024); } object set_encrypted(string data) { - check_size(data, 2048); + return check_size(data, 2048); } //! Receive data read from the network. -- GitLab