From 434ddab2d405b8917ed4925d4973c442604218cf Mon Sep 17 00:00:00 2001 From: Alfred Bratterud Date: Tue, 21 Jun 2016 21:31:16 +0200 Subject: [PATCH] Fix #595 --- api/net/ethernet.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/net/ethernet.hpp b/api/net/ethernet.hpp index 8dc1e20c40..20375c8f2a 100644 --- a/api/net/ethernet.hpp +++ b/api/net/ethernet.hpp @@ -73,8 +73,8 @@ namespace net { // hex string representation std::string str() const { - char eth_addr[17]; - sprintf(eth_addr, "%1x:%1x:%1x:%1x:%1x:%1x", + char eth_addr[18]; + snprintf(eth_addr, sizeof(eth_addr), "%1x:%1x:%1x:%1x:%1x:%1x", part[0], part[1], part[2], part[3], part[4], part[5]); return eth_addr;