diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-24 00:39:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-24 00:39:54 +0300 |
commit | 1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e (patch) | |
tree | ea4841ac780e199292b086cb8d1322f2b5bbc6be /object-file.c | |
parent | ea78f9ee7a595d9e85195c0802d9170fe4ce442e (diff) | |
parent | 7c898554d7a80e5d70ee8816a23dc425d2f1729c (diff) |
Merge branch 'ab/valgrind-fixes'
A bit of test framework fixes with a few fixes to issues found by
valgrind.
* ab/valgrind-fixes:
commit-graph.c: don't assume that stat() succeeds
object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
log test: skip a failing mkstemp() test under valgrind
tests: using custom GIT_EXEC_PATH breaks --valgrind tests
Diffstat (limited to 'object-file.c')
-rw-r--r-- | object-file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/object-file.c b/object-file.c index a81d84132d..d35c1820e7 100644 --- a/object-file.c +++ b/object-file.c @@ -2623,8 +2623,12 @@ int read_loose_object(const char *path, goto out; } - if (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr), - NULL) < 0) { + switch (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr), + NULL)) { + case ULHR_OK: + break; + case ULHR_BAD: + case ULHR_TOO_LONG: error(_("unable to unpack header of %s"), path); goto out; } |