git: 9front

Download patch

ref: 443e950d0ee64d216239dce6abda35a6aafa38a8
parent: 63f44ac5158a92ec7bbbdc7e5644d084f9bc2367
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jul 12 21:17:48 EDT 2014

tftpfs: make sure path is null terminated

--- a/sys/src/cmd/ip/tftpfs.c
+++ b/sys/src/cmd/ip/tftpfs.c
@@ -53,7 +53,7 @@
 	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;
--