shithub: asif

Download patch

ref: d82bab87ecc28965c91621f1193efa8badc909df
parent: 6cea0ac16962d9de3004a751302dc743c321fa95
author: qwx <qwx@sciops.net>
date: Sun Jun 5 07:11:54 EDT 2022

zalloc: fix dump nil pointer

--- a/zalloc.c
+++ b/zalloc.c
@@ -20,7 +20,7 @@
 	void data[];
 };
 struct Ztail{
-	Zpool *z;
+	Zhouse *z;
 };
 struct Zhouse{
 	Zpool;
@@ -117,9 +117,9 @@
 	u = emalloc(Ninc * n);
 	for(v=u; v<u+Ninc*n; v+=n){
 		p = (Znode *)v;
+		p->z = z;
 		t = n2t(p);
-		p->z = z->z;
-		t->z = z->z;
+		t->z = z;
 		zlink(p, z);
 	}
 }