From: Colin Walters Date: Wed, 4 Oct 2017 14:24:21 +0000 (-0400) Subject: lib/sysroot: Fix pointer going out of scope in unlock code X-Git-Tag: archive/raspbian/2017.14-1+rpi1^2^2^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f0b69fd07414a13e2341884294e561a7e67defdd;p=ostree.git lib/sysroot: Fix pointer going out of scope in unlock code Fixes Coverity CID #1457317 Closes: #1249 Approved by: jlebon Origin: upstream, 2017.13, commit:351ffdb9778436b193ba9d2fbeebe2358e55004f Gbp-Pq: Topic 2017.13 Gbp-Pq: Name lib-sysroot-Fix-pointer-going-out-of-scope-in-unlock-code.patch --- diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index fe61a12e..2ee5eb56 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -1698,6 +1698,7 @@ ostree_sysroot_deployment_unlock (OstreeSysroot *self, return FALSE; const char *ovl_options = NULL; + static const char hotfix_ovl_options[] = "lowerdir=usr,upperdir=.usr-ovl-upper,workdir=.usr-ovl-work"; switch (unlocked_state) { case OSTREE_DEPLOYMENT_UNLOCKED_NONE: @@ -1705,7 +1706,6 @@ ostree_sysroot_deployment_unlock (OstreeSysroot *self, break; case OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX: { - const char hotfix_ovl_options[] = "lowerdir=usr,upperdir=.usr-ovl-upper,workdir=.usr-ovl-work"; /* Create the overlayfs directories in the deployment root * directly for hotfixes. The ostree-prepare-root.c helper * is also set up to detect and mount these.