Skip to content

Commit 4d4befa

Browse files
committed
pack: check pack_window_open return
1 parent 9bb61ba commit 4d4befa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,10 @@ static int packfile_unpack_compressed(
844844
unsigned int window_len;
845845
unsigned char *in;
846846

847-
in = pack_window_open(p, mwindow, *position, &window_len);
847+
if ((in = pack_window_open(p, mwindow, *position, &window_len)) == NULL) {
848+
error = -1;
849+
goto out;
850+
}
848851

849852
if ((error = git_zstream_set_input(&zstream, in, window_len)) < 0 ||
850853
(error = git_zstream_get_output_chunk(data + total, &bytes, &zstream)) < 0) {

0 commit comments

Comments
 (0)