From e9585ceb5333674e88ddb2ee8bd2702dd7badc98 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 25 Feb 2020 15:51:38 +0100 Subject: [PATCH] Release 6.0.11: Hotfix: Do not return pointer to member of destroyed pkgmgr structure Change-Id: Ibe121a4d98cec1fe4aaaf61dd8b321f0c88ddd9a --- packaging/crash-worker.spec | 2 +- packaging/crash-worker_system-tests.spec | 2 +- src/crash-manager/crash-manager.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec index da4e97e..65afbef 100644 --- a/packaging/crash-worker.spec +++ b/packaging/crash-worker.spec @@ -13,7 +13,7 @@ Name: crash-worker Summary: Coredump handler and report generator for Tizen -Version: 6.0.10 +Version: 6.0.11 Release: 1 Group: Framework/system License: Apache-2.0 and BSD-2-Clause and MIT diff --git a/packaging/crash-worker_system-tests.spec b/packaging/crash-worker_system-tests.spec index 99fba32..8e1061e 100644 --- a/packaging/crash-worker_system-tests.spec +++ b/packaging/crash-worker_system-tests.spec @@ -8,7 +8,7 @@ Name: crash-worker_system-tests Summary: Package with binaries and scripts for crash-worker system tests -Version: 6.0.10 +Version: 6.0.11 Release: 1 Group: Framework/system License: Apache-2.0 and BSD diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c index 669e9da..1958578 100644 --- a/src/crash-manager/crash-manager.c +++ b/src/crash-manager/crash-manager.c @@ -124,11 +124,11 @@ static bool get_appid(char *exepath, char **appid) have_appid = aid != NULL; if (have_appid) - *appid = aid; + *appid = strdup(aid); out_free: pkgmgrinfo_appinfo_filter_destroy(handle); - return have_appid; + return have_appid && *appid != NULL; } static bool get_pkgid(char *appid, char **pkgid) @@ -145,11 +145,11 @@ static bool get_pkgid(char *appid, char **pkgid) have_pkgid = p != NULL; if (have_pkgid) - *pkgid = p; + *pkgid = strdup(p); out_free: pkgmgrinfo_appinfo_destroy_appinfo(handle); - return have_pkgid; + return have_pkgid && *pkgid != NULL; } static bool set_appinfo(char *exepath, char **appid, char **pkgid) -- 2.7.4