aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tls/tls_reader.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tls/tls_reader.h b/src/tls/tls_reader.h
index 3a45235b5..a7ef512e9 100644
--- a/src/tls/tls_reader.h
+++ b/src/tls/tls_reader.h
@@ -22,6 +22,12 @@ class TLS_Data_Reader
TLS_Data_Reader(const MemoryRegion<byte>& buf_in) :
buf(buf_in), offset(0) {}
+ ~TLS_Data_Reader()
+ {
+ if(has_remaining())
+ throw Decoding_Error("Extra bytes at end of message");
+ }
+
size_t remaining_bytes() const
{
return buf.size() - offset;