Commit 18336eedac11f139b496ab3f1a16bbbc92652b76

Stefan Sperling 2018-11-04T14:29:05

fix error check in got_privsep_recv_blob()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/privsep.c b/lib/privsep.c
index be1744b..8da8e2c 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -810,8 +810,10 @@ got_privsep_recv_blob(size_t *size, struct imsgbuf *ibuf)
 		err = recv_imsg_error(&imsg, datalen);
 		break;
 	case GOT_IMSG_BLOB:
-		if (datalen != sizeof(iblob))
+		if (datalen != sizeof(iblob)) {
 			err = got_error(GOT_ERR_PRIVSEP_LEN);
+			break;
+		}
 		memcpy(&iblob, imsg.data, sizeof(iblob));
 		*size = iblob.size;
 		/* Data has been written to file descriptor. */