From 219c3121638214be8f1d4750510729a058fe2c8e Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 28 Apr 2014 02:32:06 +0200 Subject: [PATCH] libip: use snprint() in myetheraddr() to prevent accidents --- sys/src/libip/myetheraddr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/libip/myetheraddr.c b/sys/src/libip/myetheraddr.c index 76f7cff54..7172e5880 100644 --- a/sys/src/libip/myetheraddr.c +++ b/sys/src/libip/myetheraddr.c @@ -9,9 +9,9 @@ myetheraddr(uchar *to, char *dev) char buf[256]; if(*dev == '/' || *dev == '#') - sprint(buf, "%s/addr", dev); + snprint(buf, sizeof buf, "%s/addr", dev); else - sprint(buf, "/net/%s/addr", dev); + snprint(buf, sizeof buf, "/net/%s/addr", dev); fd = open(buf, OREAD); if(fd < 0)