Release 6.0.11: Hotfix: Do not return pointer to member of destroyed pkgmgr structure 44/225944/2 accepted/tizen/unified/20200227.121108 submit/tizen/20200225.153334
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 25 Feb 2020 14:51:38 +0000 (15:51 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 25 Feb 2020 15:17:48 +0000 (16:17 +0100)
Change-Id: Ibe121a4d98cec1fe4aaaf61dd8b321f0c88ddd9a

packaging/crash-worker.spec
packaging/crash-worker_system-tests.spec
src/crash-manager/crash-manager.c

index da4e97e..65afbef 100644 (file)
@@ -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
index 99fba32..8e1061e 100644 (file)
@@ -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
index 669e9da..1958578 100644 (file)
@@ -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)