Commit 54b1c5b5cbd5f12a0e6d6e8a7e043528416012d2

Stefan Sperling 2020-02-22T12:37:58

don't proceed if a bad imsg is received in recv_gitconfig_remotes()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/privsep.c b/lib/privsep.c
index 3c5dd60..5528473 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -1501,8 +1501,8 @@ got_privsep_recv_gitconfig_remotes(struct got_remote_repo **remotes,
 		}
 		break;
 	default:
-		err = got_error(GOT_ERR_PRIVSEP_MSG);
-		break;
+		imsg_free(&imsg);
+		return got_error(GOT_ERR_PRIVSEP_MSG);
 	}
 
 	imsg_free(&imsg);