[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] 348160
[problem] Prevent issue type 'Copy into fixed size buffer'
[cause]
[solution] Copy string by using strncpy
[team] HomeTF
[request]
[horizontal_expansion]
Change-Id: I6a9b9b985fd514e3f6ed03f63ddf1dafeacfeb93
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
return;
}
+#define CMD_BUFFER_SIZE 256
+
static Eina_Bool input_cb(void *data, Ecore_Fd_Handler *fd_handler)
{
static int idx = 0;
- static char cmd_buffer[256];
+ static char cmd_buffer[CMD_BUFFER_SIZE];
unsigned char ch;
int fd;
int ret;
cmd_buffer[0] = '\0';
prompt(NULL);
} else {
- strcpy(cmd_buffer, tmp);
+ strncpy(cmd_buffer, tmp, CMD_BUFFER_SIZE - 1);
+ cmd_buffer[CMD_BUFFER_SIZE - 1] = '\0';
idx = strlen(cmd_buffer);
prompt(cmd_buffer);
}