From cc001c31a7c2ac9f01c334adb2ff78da59c91436 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 13 Jul 2014 01:17:48 +0200 Subject: [PATCH] tftpfs: make sure path is null terminated --- sys/src/cmd/ip/tftpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/ip/tftpfs.c b/sys/src/cmd/ip/tftpfs.c index ed7c70e05..7f1fcb003 100644 --- a/sys/src/cmd/ip/tftpfs.c +++ b/sys/src/cmd/ip/tftpfs.c @@ -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;