diff options
author | Simon Warta <[email protected]> | 2015-06-29 14:02:37 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-30 10:38:23 +0200 |
commit | 1de5fc1419add86884df97580d7a2e745ad43bff (patch) | |
tree | 295eafb79cab7843888133abbad07fb983915520 /src/lib/tls/tls_handshake_io.cpp | |
parent | 8668ce8753b10e944bdc72b6e66d752759c7e710 (diff) |
More changes for use with debug STL
Diffstat (limited to 'src/lib/tls/tls_handshake_io.cpp')
-rw-r--r-- | src/lib/tls/tls_handshake_io.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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<byte>& 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; } |