Commit Diff


commit - 79fcf3e43005b490af3c5501cd760508e3192f68
commit + 904df868d68e12778fedf815fe73a70919d71b19
blob - f27463409c46e08dacad59956ecfe3d0217b9615
blob + 325eec8a4a865b83e3bde9ce509f2fc339a25189
--- lib/privsep.c
+++ lib/privsep.c
@@ -446,10 +446,12 @@ got_privsep_send_commit(struct imsgbuf *ibuf, struct g
 		goto done;
 	}
 
-	err = flush_imsg(ibuf);
-	if (err)
-		goto done;
-
+	if (logmsg_len == 0 ||
+	    logmsg_len + len > MAX_IMSGSIZE - IMSG_HEADER_SIZE) {
+		err = flush_imsg(ibuf);
+		if (err)
+			goto done;
+	}
 	err = send_commit_logmsg(ibuf, commit, logmsg_len);
 done:
 	free(buf);