fix dereference without checking and uninitialized data issue 93/97193/1 accepted/tizen/3.0/common/20161116.143526 accepted/tizen/3.0/ivi/20161116.022245 accepted/tizen/3.0/mobile/20161116.022026 accepted/tizen/3.0/tv/20161116.022129 accepted/tizen/3.0/wearable/20161116.022208 submit/tizen_3.0/20161111.111420 submit/tizen_3.0/20161115.024443
authorJiwoong Im <jiwoong.im@samsung.com>
Fri, 11 Nov 2016 10:54:20 +0000 (19:54 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Fri, 11 Nov 2016 11:03:42 +0000 (20:03 +0900)
Change-Id: Ieafa8553bcd791f621daa9e9f4715c87d96a5250
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
lib/buxton2.c
migration/vconf_migration.c

index 708052f..a221f86 100644 (file)
@@ -2112,6 +2112,8 @@ EXPORT int buxton_enable_security_sync(struct buxton_client *client)
        struct bxt_req *req;
        struct response resp;
 
+       memset(&resp, 0, sizeof(resp));
+
        pthread_mutex_lock(&clients_lock);
        req = security_control(client, TRUE, security_sync_cb, &resp);
        if (!req) {
@@ -2157,6 +2159,8 @@ EXPORT int buxton_disable_security_sync(struct buxton_client *client)
        struct bxt_req *req;
        struct response resp;
 
+       memset(&resp, 0, sizeof(resp));
+
        pthread_mutex_lock(&clients_lock);
        req = security_control(client, FALSE, security_sync_cb, &resp);
        if (!req) {
@@ -2253,6 +2257,8 @@ EXPORT int buxton_update_client_label_sync(struct buxton_client *client)
        struct bxt_req *req;
        struct response resp;
 
+       memset(&resp, 0, sizeof(resp));
+
        pthread_mutex_lock(&clients_lock);
        req = update_client_label(client, update_label_sync_cb, &resp);
        if (!req) {
index 3ade7a4..8580b69 100644 (file)
@@ -54,6 +54,9 @@ static void _get_vconf_keys(const char *path, keylist_t *keylist)
 
        keyname = strrchr(path, '/');
 
+       if (keyname == NULL)
+               goto out_func;
+
        while (*(keyname - 1) != '/')
                keyname--;