git: 9front

Download patch

ref: a4a412e4dda8e56bdcf820bf94a18e7b5f6968ec
parent: 3f47b43691c6ccdfb8c57ecbc605df10eebf5736
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Mar 2 16:08:48 EST 2014

cc: correct out-of-bounds references in funct.c (thanks charles forsyth)

--- a/sys/src/cmd/cc/funct.c
+++ b/sys/src/cmd/cc/funct.c
@@ -238,7 +238,7 @@
 		goto bad;
 
 	f = alloc(sizeof(*f));
-	for(o=0; o<sizeof(f->sym); o++)
+	for(o=0; o<nelem(f->sym); o++)
 		f->sym[o] = S;
 
 	t->funct = f;
--