Add checker for checking when receive invalid storage uuid 43/104243/1 accepted/tizen/common/20161214.160352 accepted/tizen/ivi/20161214.015255 accepted/tizen/mobile/20161214.014702 accepted/tizen/tv/20161214.015034 accepted/tizen/wearable/20161214.015218 submit/tizen/20161213.083228
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 13 Dec 2016 01:57:41 +0000 (10:57 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 13 Dec 2016 01:57:41 +0000 (10:57 +0900)
Change-Id: Ica8f535d8e618176763736b891bf9a6a14a888d7
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/media-server.spec
src/scanner/media-scanner-scan.c

index 4ac3923..481bd87 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.22
+Version:    0.3.23
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 5981ae5..3450a5c 100755 (executable)
@@ -861,10 +861,20 @@ gboolean msc_storage_scan_thread(void *data)
                storage_type = ms_get_storage_type_by_full(scan_data->msg, scan_data->uid);
                update_path = strndup(scan_data->msg, scan_data->msg_size);
 
-               if (strlen(scan_data->storage_id) > 0)
+               if (strlen(scan_data->storage_id) > 0) {
+                       /*MS_DBG("path : [%s], storage_id : [%s]", scan_data->msg, scan_data->storage_id);*/
                        storage_id = strdup(scan_data->storage_id);
-               else
-                       storage_id = strdup("media");
+               } else {
+                       MS_DBG_ERR("storage_id length is 0. There is no information of your request [%s]", scan_data->msg);
+                       ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+                       goto NEXT;
+               }
+
+               if (storage_id == NULL) {
+                       MS_DBG_ERR("storage_id NULL");
+                       ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+                       goto NEXT;
+               }
 
                ret = ms_set_storage_scan_status(handle, storage_id, MEDIA_SCAN_PROCESSING, scan_data->uid);
                if (ret != MS_MEDIA_ERR_NONE) {