Skip to content

Commit 8c16ef8

Browse files
committed
load_pack_mtimes_file(): avoid accessing uninitialized data
The `mtimes_size` variable is uninitialzed when the function errors out, yet its value is assigned to another variable. Let's just initialize it. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1c35a3b commit 8c16ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pack-mtimes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int load_pack_mtimes_file(char *mtimes_file,
2828
int fd, ret = 0;
2929
struct stat st;
3030
uint32_t *data = NULL;
31-
size_t mtimes_size, expected_size;
31+
size_t mtimes_size = 0, expected_size;
3232
struct mtimes_header header;
3333

3434
fd = git_open(mtimes_file);

0 commit comments

Comments
 (0)