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/MAC.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'node/MAC.hpp') diff --git a/node/MAC.hpp b/node/MAC.hpp index f33277c0..9765aa59 100644 --- a/node/MAC.hpp +++ b/node/MAC.hpp @@ -30,8 +30,9 @@ #include #include -#include "Array.hpp" + #include "Constants.hpp" +#include "Array.hpp" #include "Utils.hpp" namespace ZeroTier { @@ -150,7 +151,7 @@ public: inline std::string toString() const { char tmp[32]; - sprintf(tmp,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5]); + Utils::snprintf(tmp,sizeof(tmp),"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",(int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5]); return std::string(tmp); } }; -- cgit v1.2.3