shithub: gefs

Download patch

ref: 8ca246b84f53a9c5da0d781aba0950ceb6dfa952
parent: 2b79e9eed57df7edd0549706ae59b7021fa0f0a8
author: Michael Forney <[email protected]>
date: Sun Feb 27 16:51:01 EST 2022

tree: copy value into buffer before applying updates

--- a/tree.c
+++ b/tree.c
@@ -465,6 +465,8 @@
 			goto Copy;
 		case 0:
 			i++;
+			if(m.op != Oinsert)
+				cpkvp(&v, &v, buf, sizeof(buf));
 			while(j < up->hi){
 				if(m.op == Oclearb){
 					bp = unpackbp(v.v, v.nv);
@@ -657,6 +659,8 @@
 			goto Copy;
 		case 0:
 			i++;
+			if(m.op != Oinsert)
+				cpkvp(&v, &v, buf, sizeof(buf));
 			while(j < up->hi){
 				ok = apply(&v, &m, buf, sizeof(buf));
 		Copy: