Fix exceptions about splash screen 91/76491/1 accepted/tizen/common/20160703.125759 accepted/tizen/ivi/20160629.015657 accepted/tizen/mobile/20160629.015615 accepted/tizen/tv/20160629.015729 accepted/tizen/wearable/20160629.015535 submit/tizen/20160627.042541 submit/tizen_common/20160701.180000
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 24 Jun 2016 05:46:37 +0000 (14:46 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 24 Jun 2016 05:46:37 +0000 (14:46 +0900)
The index() returns NULL pointer if the character is not found.

Change-Id: I0835cd80f6f10c5c565cc71ad4a9cd2a285dd09c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
parser/pkgmgr_parser_db.c

index 7617d79..d50835b 100644 (file)
@@ -1785,7 +1785,7 @@ static int __insert_application_metadata_splashscreen_info(manifest_x *mfx)
 
                        if (strcasestr(md->key, "operation_effect=")) {
                                operation = index(md->key, '=');
-                               if (operation[1] != '\0')
+                               if (operation && operation[1] != '\0')
                                        operation++;
                                else
                                        operation = NULL;
@@ -1802,19 +1802,19 @@ static int __insert_application_metadata_splashscreen_info(manifest_x *mfx)
                        while (token != NULL) {
                                if (strcasestr(token, "portrait-effectimage=")) {
                                        portraitimg = index(token, '=');
-                                       if (portraitimg[1] != '\0')
+                                       if (portraitimg && portraitimg[1] != '\0')
                                                portraitimg++;
                                        else
                                                portraitimg = NULL;
                                } else if (strcasestr(token, "landscape-effectimage=")) {
                                        landscapeimg = index(token, '=');
-                                       if (landscapeimg[1] != '\0')
+                                       if (landscapeimg && landscapeimg[1] != '\0')
                                                landscapeimg++;
                                        else
                                                landscapeimg = NULL;
                                } else if (strcasestr(token, "indicatordisplay=")) {
                                        indicatordisplay = index(token, '=');
-                                       if (indicatordisplay[1] != '\0')
+                                       if (indicatordisplay && indicatordisplay[1] != '\0')
                                                indicatordisplay++;
                                        else
                                                indicatordisplay = "true";