shithub: riscv

Download patch

ref: cc001c31a7c2ac9f01c334adb2ff78da59c91436
parent: e4d29ea9a7ddc5c5b803ff51ba54baff832b9680
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;