git: 9front

Download patch

ref: 3c38838554d5a1d6cd696f46a258af340f3d8559
parent: d74d5f1049016b153f906ead5f3e65eda3c63a05
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Aug 9 15:02:38 EDT 2023

hjfs: use smaller fixed buffer size

again, avoiding arbitrary size stack allocation
when using bio with libthread

--- a/sys/src/cmd/hjfs/auth.c
+++ b/sys/src/cmd/hjfs/auth.c
@@ -200,6 +200,7 @@
 	User *u, *v;
 	int nu, i;
 	char ubuf[USERLEN], *uname;
+	uchar bbuf[RBLOCK];
 	Biobuf buf;
 
 	rlock(&fs->udatal);
@@ -210,7 +211,7 @@
 	}else
 		nu = fs->nudata;
 
-	Binit(&buf, 2, OWRITE);
+	Binits(&buf, 2, OWRITE, bbuf, sizeof(bbuf));
 	if(ch != nil)
 		Biofn(&buf, Bchanwrite);
 	buf.aux = ch;
--