summaryrefslogtreecommitdiff
path: root/node/PacketDecoder.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-30 17:05:43 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-30 17:05:43 -0400
commitf3ad05347e55de2fd2a500464acde0979df9941f (patch)
tree57376b3114e193201dcfe2d08ef2a5bdb693ad30 /node/PacketDecoder.cpp
parent1a7e303f97507842c1a0bfffb27b76277bd43bab (diff)
downloadinfinitytier-f3ad05347e55de2fd2a500464acde0979df9941f.tar.gz
infinitytier-f3ad05347e55de2fd2a500464acde0979df9941f.zip
Improve code security posture by replacing sprintf with a safer function.
Diffstat (limited to 'node/PacketDecoder.cpp')
-rw-r--r--node/PacketDecoder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index fd817410..18d8c4e2 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -635,9 +635,9 @@ bool PacketDecoder::_doNETWORK_CONFIG_REQUEST(const RuntimeEnvironment *_r,const
request["meta"] = std::string((const char *)field(ZT_PROTO_VERB_NETWORK_CONFIG_REQUEST_IDX_DICT,dictLen),dictLen);
request["type"] = "netconf-request";
request["peerId"] = peer->identity().toString(false);
- sprintf(tmp,"%llx",(unsigned long long)nwid);
+ Utils::snprintf(tmp,sizeof(tmp),"%llx",(unsigned long long)nwid);
request["nwid"] = tmp;
- sprintf(tmp,"%llx",(unsigned long long)packetId());
+ Utils::snprintf(tmp,sizeof(tmp),"%llx",(unsigned long long)packetId());
request["requestId"] = tmp;
//TRACE("to netconf:\n%s",request.toString().c_str());
_r->netconfService->send(request);