diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-30 17:05:43 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-30 17:05:43 -0400 |
| commit | f3ad05347e55de2fd2a500464acde0979df9941f (patch) | |
| tree | 57376b3114e193201dcfe2d08ef2a5bdb693ad30 /node/MAC.hpp | |
| parent | 1a7e303f97507842c1a0bfffb27b76277bd43bab (diff) | |
| download | infinitytier-f3ad05347e55de2fd2a500464acde0979df9941f.tar.gz infinitytier-f3ad05347e55de2fd2a500464acde0979df9941f.zip | |
Improve code security posture by replacing sprintf with a safer function.
Diffstat (limited to 'node/MAC.hpp')
| -rw-r--r-- | node/MAC.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 <stdio.h> #include <stdlib.h> -#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); } }; |
