Commit 1a69d37faef36a64fd4252e75b9149b2b453752d

Omar Polo 2022-06-18T16:17:45

zero the whole struct got_imsg_object before sending it otherwise some fields may be unitialized and fail the validation done on the receiving side. ok stsp@

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/privsep.c b/lib/privsep.c
index 9f5f6ec..2d5319f 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -531,6 +531,8 @@ got_privsep_send_obj(struct imsgbuf *ibuf, struct got_object *obj)
 {
 	struct got_imsg_object iobj;
 
+	memset(&iobj, 0, sizeof(iobj));
+
 	memcpy(iobj.id, obj->id.sha1, sizeof(iobj.id));
 	iobj.type = obj->type;
 	iobj.flags = obj->flags;