From 8d452448bb1d5da09966faad65bc5aa96ba3696c Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 20 Mar 2017 09:34:59 +0100 Subject: [PATCH] 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. --- src/odb_pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odb_pack.c b/src/odb_pack.c index b80d0337a..51770a88e 100644 --- a/src/odb_pack.c +++ b/src/odb_pack.c @@ -428,7 +428,7 @@ static int pack_backend__read_prefix( git_oid_cpy(out_oid, short_oid); } else { struct git_pack_entry e; - git_rawobj raw; + git_rawobj raw = {NULL}; if ((error = pack_entry_find_prefix( &e, (struct pack_backend *)backend, short_oid, len)) == 0 &&