Unverified Commit 983f72c5 by Patrick Steinhardt Committed by GitHub

Merge pull request #4696 from nelhage/git_pkt_ref-check-len

Verify ref_pkt's are long enough
parents b121b7ac 437ee5a7
......@@ -216,6 +216,11 @@ static int ref_pkt(git_pkt **out, const char *line, size_t len)
git_pkt_ref *pkt;
size_t alloclen;
if (len < GIT_OID_HEXSZ + 1) {
giterr_set(GITERR_NET, "error parsing pkt-line");
return -1;
}
pkt = git__malloc(sizeof(git_pkt_ref));
GITERR_CHECK_ALLOC(pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment