From 1de5fc1419add86884df97580d7a2e745ad43bff Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 29 Jun 2015 14:02:37 +0200 Subject: More changes for use with debug STL --- src/lib/tls/tls_handshake_io.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lib/tls/tls_handshake_io.cpp') diff --git a/src/lib/tls/tls_handshake_io.cpp b/src/lib/tls/tls_handshake_io.cpp index d4633becd..6286eab08 100644 --- a/src/lib/tls/tls_handshake_io.cpp +++ b/src/lib/tls/tls_handshake_io.cpp @@ -95,7 +95,10 @@ Stream_Handshake_IO::format(const std::vector& msg, store_be24(&send_buf[1], buf_size); - copy_mem(&send_buf[4], msg.data(), msg.size()); + if (msg.size() > 0) + { + copy_mem(&send_buf[4], msg.data(), msg.size()); + } return send_buf; } @@ -350,7 +353,10 @@ Datagram_Handshake_IO::format_fragment(const byte fragment[], store_be24(&send_buf[6], frag_offset); store_be24(&send_buf[9], frag_len); - copy_mem(&send_buf[12], fragment, frag_len); + if (frag_len > 0) + { + copy_mem(&send_buf[12], fragment, frag_len); + } return send_buf; } -- cgit v1.2.3