Skip to content

Commit b169cd5

Browse files
committed
pack-objects: check return code of git_zstream_set_input
While `git_zstream_set_input` cannot fail right now, it might change in the future if we ever decide to have it check its parameters more vigorously. Let's thus check whether its return code signals an error.
1 parent 90450d8 commit b169cd5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pack-objects.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ static int write_object(
374374
GIT_ERROR_CHECK_ALLOC(zbuf);
375375

376376
git_zstream_reset(&pb->zstream);
377-
git_zstream_set_input(&pb->zstream, data, data_len);
377+
378+
if ((error = git_zstream_set_input(&pb->zstream, data, data_len)) < 0)
379+
goto done;
378380

379381
while (!git_zstream_done(&pb->zstream)) {
380382
if ((error = git_zstream_get_output(zbuf, &zbuf_len, &pb->zstream)) < 0 ||

0 commit comments

Comments
 (0)