From f3ad05347e55de2fd2a500464acde0979df9941f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 30 Aug 2013 17:05:43 -0400 Subject: Improve code security posture by replacing sprintf with a safer function. --- node/PacketDecoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'node/PacketDecoder.cpp') 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); -- cgit v1.2.3