object-file.c: return ULHR_TOO_LONG on "header too long"
Split up the return code for "header too long" from the generic negative return value unpack_loose_header() returns, and report via error() if we exceed MAX_HEADER_LEN. As a test added earlier in this series in t1006-cat-file.sh shows we'll correctly emit zlib errors from zlib.c already in this case, so we have no need to carry those return codes further down the stack. Let's instead just return ULHR_TOO_LONG saying we ran into the MAX_HEADER_LEN limit, or other negative values for "unable to unpack <OID> header". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3b6a8db3b0
commit
5848fb11ac
@@ -235,6 +235,7 @@ static int open_istream_loose(struct git_istream *st, struct repository *r,
|
||||
case ULHR_OK:
|
||||
break;
|
||||
case ULHR_BAD:
|
||||
case ULHR_TOO_LONG:
|
||||
goto error;
|
||||
}
|
||||
if (parse_loose_header(st->u.loose.hdr, &oi, 0) < 0)
|
||||
|
||||
Reference in New Issue
Block a user