Skip to content

Commit 8d45244

Browse files
committed
odb_pack: initialize git_rawobj structure
The `pack_entry_find_prefix` function receives a `git_rawobj` structure as argument. While the function first initializes the structure to a sensible state, Coverity is unable to correctly detect this, resulting in a warning. Fix this warning by initializing the object to all-zeroes before passing it to the function.
1 parent 2cf48e1 commit 8d45244

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/odb_pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int pack_backend__read_prefix(
428428
git_oid_cpy(out_oid, short_oid);
429429
} else {
430430
struct git_pack_entry e;
431-
git_rawobj raw;
431+
git_rawobj raw = {NULL};
432432

433433
if ((error = pack_entry_find_prefix(
434434
&e, (struct pack_backend *)backend, short_oid, len)) == 0 &&

0 commit comments

Comments
 (0)