Commit 5dd347027c7a9ca72fbafa1398c44ce9fcbc5604

Edward Thomson 2018-06-26T09:56:43

Merge branch 'nelhage/smart-no-pack'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 8a094b6..442a10f 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -70,6 +70,12 @@ int git_smart__store_refs(transport_smart *t, int flushes)
 			return -1;
 		}
 
+		if (pkt->type == GIT_PKT_PACK) {
+			giterr_set(GITERR_NET, "unexpected packfile");
+			git__free(pkt);
+			return -1;
+		}
+
 		if (pkt->type != GIT_PKT_FLUSH && git_vector_insert(refs, pkt) < 0)
 			return -1;