libip: use snprint() in myetheraddr() to prevent accidents
This commit is contained in:
parent
391198888a
commit
219c312163
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue