The str_data, a member of rqt_box structure, have 5 arrays of 32 byte in
length. Currently, a file name is limited to 32 bytes because the code
considers using just one array of the str_data for a file name. But, the
lthor can send a file name that is grater than 32 bytes. Whether it is a bug
or not, we have to transfer a long name file in this project. So, this
commit allows to send a file with a file name length of 64 - 1 bytes
temporarily. Since the rqt_box structure is __packed type, str_data has
contiguous memory and does not cause memory problems.
Change-Id: Id7380ffc5bfb398cf4049e584561943a0d1349e7
Signed-off-by: jino.cho <jino.cho@samsung.com>
}
thor_file_size = rqt->int_data[1];
- memcpy(f_name, rqt->str_data[0], F_NAME_BUF_SIZE);
+ strncpy(f_name, rqt->str_data[0], F_NAME_BUF_SIZE - 1);
debug("INFO: name(%s, %d), size(%llu), type(%d)\n",
f_name, 0, thor_file_size, file_type);
struct thor_dev *dev;
};
-#define F_NAME_BUF_SIZE 32
+#define F_NAME_BUF_SIZE 64
#define THOR_PACKET_SIZE SZ_1M /* 1 MiB */
#define THOR_STORE_UNIT_SIZE SZ_32M /* 32 MiB */
#ifdef CONFIG_THOR_RESET_OFF