shithub: gefs

Download patch

ref: 7215f386d1b053944abcd7c1745d92a9c8521076
parent: cf376782b1d9a29733a1e63b2a966aeb883e594c
author: Michael Forney <mforney@mforney.org>
date: Sat Mar 12 17:49:06 EST 2022

snap: skip grafting empty dead lists

dlinsert doesn't handle v2=-1 specially, so passing -1 will cause
it to corrupt the deadlist.

--- a/snap.c
+++ b/snap.c
@@ -126,6 +126,8 @@
 		src->head = src->ins->bp;
 		src->ins = nil;
 	}
+	if(src->head.addr == -1)
+		return 0;
 	return dlinsert(dst, src->head.addr|DlGraft, src->head.hash);
 }