summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-11-14 18:52:36 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-11-14 18:52:36 +0900
commit1b3d24e1e65153fe341647600899b0d7348d762f (patch)
treef83fa9d143183b8e51f91ee9429e90e82c899730
parent24e3ee79eb8d7d23eb91236e67c162273960fa69 (diff)
downloadshortcut-1b3d24e1e65153fe341647600899b0d7348d762f.tar.gz
shortcut-1b3d24e1e65153fe341647600899b0d7348d762f.tar.bz2
shortcut-1b3d24e1e65153fe341647600899b0d7348d762f.zip
pkgmgr doesn't give the docPtr anymore while uninstalling.
While uninstalling a package, pkgmgr doesn't give the docPtr anymore. So the plugin cannot parse the document anymore. Now the plugin should validate the docPtr before try to parse it. If the docPtr is NULL, skip to parse a document for safety. Change-Id: Idaa6841e9c6068662d57832f4be99e1a3a9236f6
-rw-r--r--pkgmgr_shortcut/src/service_register.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgmgr_shortcut/src/service_register.c b/pkgmgr_shortcut/src/service_register.c
index 83864ef..56822d3 100644
--- a/pkgmgr_shortcut/src/service_register.c
+++ b/pkgmgr_shortcut/src/service_register.c
@@ -386,7 +386,6 @@ static void do_upgrade_db_schema(void)
}
}
-
static int db_remove_record(const char *pkgid, const char *appid, const char *key, const char *data)
{
static const char *dml = "DELETE FROM shortcut_service WHERE appid = ? AND extra_key = ? AND extra_data = ? AND pkgid = ?";
@@ -969,6 +968,11 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
xmlNodePtr root;
int id;
+ if (!docPtr) {
+ DbgPrint("Package manager doesn't support the docPtr (%s)\n", _appid);
+ return 0;
+ }
+
root = xmlDocGetRootElement(docPtr);
if (!root) {
ErrPrint("Invalid node ptr\n");