summaryrefslogtreecommitdiffstats
path: root/object-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'object-file.c')
-rw-r--r--object-file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/object-file.c b/object-file.c
index ade5f33f3c..8abeb9ace8 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1245,7 +1245,7 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
* --allow-unknown-type".
*/
if (!header)
- return ULHR_BAD;
+ return ULHR_TOO_LONG;
/*
* buffer[0..bufsiz] was not large enough. Copy the partial
@@ -1266,7 +1266,7 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
stream->next_out = buffer;
stream->avail_out = bufsiz;
} while (status != Z_STREAM_END);
- return ULHR_BAD;
+ return ULHR_TOO_LONG;
}
static void *unpack_loose_rest(git_zstream *stream,
@@ -1439,6 +1439,10 @@ static int loose_object_info(struct repository *r,
status = error(_("unable to unpack %s header"),
oid_to_hex(oid));
break;
+ case ULHR_TOO_LONG:
+ status = error(_("header for %s too long, exceeds %d bytes"),
+ oid_to_hex(oid), MAX_HEADER_LEN);
+ break;
}
if (status < 0) {