Add error handling for object copy 86/180586/1 accepted/tizen/unified/20180611.015604 submit/tizen/20180531.055155 submit/tizen/20180531.073839 submit/tizen/20180601.022814 submit/tizen/20180607.015054 submit/tizen/20180608.043218
authorJihoon Jung <jh8801.jung@samsung.com>
Thu, 31 May 2018 05:39:00 +0000 (14:39 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Thu, 31 May 2018 05:39:48 +0000 (14:39 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: Ib001c85a9bb3f3a1294b76aab9889e2da50b2b59

include/mtp_config.h
packaging/mtp-responder.spec
src/mtp_cmd_handler_util.c

index eac1d2e5ec975eacb46d41617da6a0dd01af493d..5d379860980912d4d5f656ee6d2e6c599ec2095d 100755 (executable)
 #define MTP_UNKNOWN_METADATAW          L"Unknown"
 
 /* strlen(/opt/usr/share/crash/) + MTP path len limit */
-#define MTP_MAX_PATHNAME_SIZE          (21 + 255)      /* except \0 */
-#define MTP_MAX_FILENAME_SIZE          (254)   /* except \0 */
+#define MTP_MAX_PATHNAME_SIZE          (21 + 1024)     /* except \0 */
+#define MTP_MAX_FILENAME_SIZE          (1024)  /* except \0 */
 
 #define MTP_MAX_CMD_BLOCK_SIZE         36      /* Bytes */
 
index d6f5a6eabc015e35bf3c24dc88cb401058823f8e..1cc2c676a7e0f23de167400cd2e68abe3d810f9d 100755 (executable)
@@ -5,7 +5,7 @@ ExcludeArch: %arm aarch64
 
 Name:       mtp-responder
 Summary:    Media Transfer Protocol daemon (responder)
-Version:    0.0.28
+Version:    0.0.29
 Release:    1
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index 2b4d495625710926d7506a7c29f6ee0f1631c7c2..8bde5db6f91cd2123cef53626f6380b3fbc7fb39 100755 (executable)
@@ -1595,6 +1595,12 @@ mtp_err_t _hutil_construct_object_entry_prop_list(mtp_uint32 store_id,
                return MTP_ERROR_STORE_FULL;
        }
 
+       if (store->store_info.free_space <= obj_sz) {
+               ERR("free space is not enough [%ld bytes]\n",
+                               store->store_info.free_space);
+               return MTP_ERROR_STORE_FULL;
+       }
+
        obj_info = _entity_alloc_object_info();
        if (obj_info == NULL) {
                ERR("_entity_alloc_object_info Fail");