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/MulticastGroup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'node/MulticastGroup.hpp') diff --git a/node/MulticastGroup.hpp b/node/MulticastGroup.hpp index 3c654ea2..9f2b111d 100644 --- a/node/MulticastGroup.hpp +++ b/node/MulticastGroup.hpp @@ -106,7 +106,7 @@ public: inline std::string toString() const { char buf[64]; - sprintf(buf,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x/%.8lx",(unsigned int)_mac.data[0],(unsigned int)_mac.data[1],(unsigned int)_mac.data[2],(unsigned int)_mac.data[3],(unsigned int)_mac.data[4],(unsigned int)_mac.data[5],(unsigned long)_adi); + Utils::snprintf(buf,sizeof(buf),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x/%.8lx",(unsigned int)_mac.data[0],(unsigned int)_mac.data[1],(unsigned int)_mac.data[2],(unsigned int)_mac.data[3],(unsigned int)_mac.data[4],(unsigned int)_mac.data[5],(unsigned long)_adi); return std::string(buf); } -- cgit v1.2.3