mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'jk/sha1-loose-object-info-fix'
Leakfix and futureproofing. * jk/sha1-loose-object-info-fix: sha1_loose_object_info: handle errors from unpack_sha1_rest
This commit is contained in:
commit
40abbe4306
|
@ -1124,10 +1124,14 @@ static int sha1_loose_object_info(const unsigned char *sha1,
|
|||
} else if ((status = parse_sha1_header_extended(hdr, oi, flags)) < 0)
|
||||
status = error("unable to parse %s header", sha1_to_hex(sha1));
|
||||
|
||||
if (status >= 0 && oi->contentp)
|
||||
if (status >= 0 && oi->contentp) {
|
||||
*oi->contentp = unpack_sha1_rest(&stream, hdr,
|
||||
*oi->sizep, sha1);
|
||||
else
|
||||
if (!*oi->contentp) {
|
||||
git_inflate_end(&stream);
|
||||
status = -1;
|
||||
}
|
||||
} else
|
||||
git_inflate_end(&stream);
|
||||
|
||||
munmap(map, mapsize);
|
||||
|
|
Loading…
Reference in a new issue