Fixing segfault in get_app_gids when app_id = NULL
authorZbigniew Jasinski <z.jasinski@samsung.com>
Fri, 5 Jul 2013 07:54:18 +0000 (09:54 +0200)
committerZbigniew Jasinski <z.jasinski@samsung.com>
Fri, 5 Jul 2013 07:54:46 +0000 (09:54 +0200)
Change-Id: I1b9e182366da921f1a6bfee50a87e694ca3c1f7f

src/access-db.c

index e635a3a..dcee10a 100644 (file)
@@ -339,6 +339,11 @@ int get_app_gids(const char *app_id, unsigned **gids, int *len)
                        goto out;
                }
 
+        if (NULL == app_id) {
+            *len = 0;
+            return PC_OPERATION_SUCCESS;
+        }
+
                if (!strcmp(app_id, app_id_tmp)) {
                        unsigned *gids_realloc = realloc(*gids, sizeof(unsigned) * (*len + 1));
                        if (gids_realloc == NULL) {