Add checker for checking when receive invalid storage uuid 42/104242/1 submit/tizen_3.0/20161213.081002
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 13 Dec 2016 01:54:33 +0000 (10:54 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 13 Dec 2016 01:54:33 +0000 (10:54 +0900)
Change-Id: I609fdb1bf5c416214e8c85ccc303460cb1968db2
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/media-server.spec
src/scanner/media-scanner-scan.c

index ebff942..c0a0f10 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) {