shithub: riscv

Download patch

ref: 43ad9018a505c98e6cd408313d17dc22ace28494
parent: 997c75bc9698306afac99208f76f049bdd25f873
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;