summaryrefslogtreecommitdiff
path: root/node/Packet.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-02 10:06:29 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-02 10:06:29 -0700
commite53d208ea4ca7c6496c976be6db3383d99f993c3 (patch)
tree9dd2873eab5c593bf452768cae9e8c93af72ed28 /node/Packet.hpp
parente8c5495b61ebde115ee133e8c85933191bd0cd61 (diff)
downloadinfinitytier-e53d208ea4ca7c6496c976be6db3383d99f993c3.tar.gz
infinitytier-e53d208ea4ca7c6496c976be6db3383d99f993c3.zip
Improve security posture by eliminating non-const data() accessor from Buffer.
Diffstat (limited to 'node/Packet.hpp')
-rw-r--r--node/Packet.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Packet.hpp b/node/Packet.hpp
index 6786a8e5..3cf77b33 100644
--- a/node/Packet.hpp
+++ b/node/Packet.hpp
@@ -383,13 +383,13 @@ public:
setSize(fragLen + ZT_PROTO_MIN_FRAGMENT_LENGTH);
// NOTE: this copies both the IV/packet ID and the destination address.
- memcpy(field(ZT_PACKET_FRAGMENT_IDX_PACKET_ID,13),p.data() + ZT_PACKET_IDX_IV,13);
+ memcpy(field(ZT_PACKET_FRAGMENT_IDX_PACKET_ID,13),field(ZT_PACKET_IDX_IV,13),13);
(*this)[ZT_PACKET_FRAGMENT_IDX_FRAGMENT_INDICATOR] = ZT_PACKET_FRAGMENT_INDICATOR;
(*this)[ZT_PACKET_FRAGMENT_IDX_FRAGMENT_NO] = (char)(((fragTotal & 0xf) << 4) | (fragNo & 0xf));
(*this)[ZT_PACKET_FRAGMENT_IDX_HOPS] = 0;
- memcpy(field(ZT_PACKET_FRAGMENT_IDX_PAYLOAD,fragLen),p.data() + fragStart,fragLen);
+ memcpy(field(ZT_PACKET_FRAGMENT_IDX_PAYLOAD,fragLen),field(fragStart,fragLen),fragLen);
}
/**