Fix svace error (160318) - use of vulnerable function
Use of vulnerable function 'strcpy' at iotjs_module_dns.c
it's changed to strncpy
IoT.js-DCO-1.0-Signed-off-by: Haesik, Jun
@@ -196,7 +196,7 @@ JHANDLER_FUNCTION(GetAddrInfo) {
const char* hostname_data = iotjs_string_data(&hostname);
if (strcmp(hostname_data, "localhost") == 0) {
- strcpy(ip, "127.0.0.1");
+ strncpy(ip, "127.0.0.1", sizeof("127.0.0.1")+1);
} else {
struct sockaddr_in addr;
