tftpfs: make sure path is null terminated

This commit is contained in:
cinap_lenrek 2014-07-13 01:17:48 +02:00
parent e4d29ea9a7
commit cc001c31a7

View file

@ -53,7 +53,7 @@ tfileget(uchar *addr, char *path)
f = emalloc9p(sizeof *f);
memset(f, 0, sizeof(*f));
ipmove(f->addr, addr);
strncpy(f->path, path, sizeof(f->path));
strncpy(f->path, path, Maxpath-1);
f->ref = 1;
f->id = id++;
f->next = files;