From: Colin Walters Date: Wed, 4 Oct 2017 14:22:05 +0000 (-0400) Subject: lib/core: Init struct stat buffer X-Git-Tag: archive/raspbian/2017.14-1+rpi1^2^2^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=96ffebe7370d2075133288c8dff6603a9f43a16c;p=ostree.git lib/core: Init struct stat buffer Regression from d57410a7e62dcb89321807dcb2d91c85f9d26df7 Fixes Coverity CID #1457316 Closes: #1249 Approved by: jlebon Origin: upstream, 2017.13, commit:e80efe0b0668a351361bb0a218a809434dd33d63 Gbp-Pq: Topic 2017.13 Gbp-Pq: Name lib-core-Init-struct-stat-buffer.patch --- diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index 08c28924..7fa051f2 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -1614,10 +1614,13 @@ _ostree_gfileinfo_equal (GFileInfo *a, GFileInfo *b) return TRUE; } +/* Many parts of libostree only care about mode,uid,gid - this creates + * a new GFileInfo with those fields see. + */ GFileInfo * _ostree_mode_uidgid_to_gfileinfo (mode_t mode, uid_t uid, gid_t gid) { - struct stat stbuf; + struct stat stbuf = { 0, }; stbuf.st_mode = mode; stbuf.st_uid = uid; stbuf.st_gid = gid;