Fix null pointer access which is dereferenced at DcmScanSvc.cpp:493, may have NULL... 29/98829/1 accepted/tizen/common/20161122.192818 accepted/tizen/ivi/20161122.235919 accepted/tizen/mobile/20161122.235712 accepted/tizen/tv/20161122.235754 accepted/tizen/wearable/20161122.235836 submit/tizen/20161122.044017
authorJiyong Min <jiyong.min@samsung.com>
Mon, 21 Nov 2016 03:46:05 +0000 (12:46 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Mon, 21 Nov 2016 03:48:54 +0000 (19:48 -0800)
Change-Id: I9ac4cd0b14b9e7b4dd0a1bd9a930e5b451a2c04c
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
src/DcmScanSvc.cpp

index 1d62944dd3a788637be3e79ee1c29088e425e011..57fe46bf36d98eff2ab9673b6ae42359f397d959 100755 (executable)
@@ -453,6 +453,7 @@ int DcmScanSvc::ScanSingleItem(const char *file_path)
        int ret = DCM_SUCCESS;
        DcmScanItem *scan_item = NULL;
        DcmDbUtils *dcmDbUtils = DcmDbUtils::getInstance();
+       int face_count = 0;
 
        DCM_CHECK_VAL(file_path, DCM_ERROR_INVALID_PARAMETER);
 
@@ -490,7 +491,12 @@ int DcmScanSvc::ScanSingleItem(const char *file_path)
                (scan_single_curr_index)++;
        }
 
-       sendCompletedMsg( file_path/*ret*/, scan_item->face_count, DCM_IPC_PORT_DCM_RECV);
+       if (scan_item != NULL)
+               face_count = scan_item->face_count;
+       else
+               face_count = 0;
+
+       sendCompletedMsg( file_path/*ret*/, face_count, DCM_IPC_PORT_DCM_RECV);
 
        clearSingleItemList();