libip: use snprint() in myetheraddr() to prevent accidents

This commit is contained in:
cinap_lenrek 2014-04-28 02:32:06 +02:00
parent 391198888a
commit 219c312163

View file

@ -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)