From 98a953a824d69cd1e5a799f927dc4c16b951a4e5 Mon Sep 17 00:00:00 2001 From: ilho kim Date: Mon, 7 Aug 2023 14:37:41 +0900 Subject: [PATCH] Fix static analysis issue Avoid null pointer dereference Change-Id: Id47e7cf188e299142a090e08f696810ac8e66f45 Signed-off-by: ilho kim --- src/server/appinfo_internal.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/appinfo_internal.cc b/src/server/appinfo_internal.cc index f56b175..1e05dce 100644 --- a/src/server/appinfo_internal.cc +++ b/src/server/appinfo_internal.cc @@ -638,7 +638,8 @@ int DoGetAppInfo(const tizen_base::Database& db, uid_t db_uid, uid_t uid, } else { tmp_record = GetCString(idx++, rec); if (tmp_record != nullptr) { - if (strcasecmp(info->is_disabled, "false") == 0 && + if (info->is_disabled && + strcasecmp(info->is_disabled, "false") == 0 && strcasecmp(tmp_record, "false") == 0) { free(info->is_disabled); info->is_disabled = tmp_record; @@ -648,7 +649,8 @@ int DoGetAppInfo(const tizen_base::Database& db, uid_t db_uid, uid_t uid, } tmp_record = GetCString(idx++, rec); if (tmp_record != nullptr) { - if (strcasecmp(info->splash_screen_display, "false") == 0 && + if (info->splash_screen_display && + strcasecmp(info->splash_screen_display, "false") == 0 && strcasecmp(tmp_record, "false") == 0) { free(info->splash_screen_display); info->splash_screen_display = tmp_record; -- 2.7.4