diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-08-21 11:15:21 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-08-21 11:15:21 -0700 |
commit | a784abaff631449533d44846987c1537c080e03d (patch) | |
tree | 0982d9a92450edb9e46ba683d75eb7822ea004b3 /deps/uv/src/uv-common.c | |
parent | 41f55dc59b423b8b76e6f7971fd8f3a326a6fbad (diff) | |
download | android-node-v8-a784abaff631449533d44846987c1537c080e03d.tar.gz android-node-v8-a784abaff631449533d44846987c1537c080e03d.tar.bz2 android-node-v8-a784abaff631449533d44846987c1537c080e03d.zip |
uv: Upgrade to v0.11.8
Diffstat (limited to 'deps/uv/src/uv-common.c')
-rw-r--r-- | deps/uv/src/uv-common.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 532f53fc47..95f5011f1d 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -154,11 +154,12 @@ struct sockaddr_in6 uv_ip6_addr(const char* ip, int port) { #if defined(UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS) zone_index = strchr(ip, '%'); if (zone_index != NULL) { - address_part_size = sizeof(address_part); - assert((unsigned)(zone_index - ip) < address_part_size); - strncpy(address_part, ip, zone_index - ip); - address_part[address_part_size - 1] = '\0'; + address_part_size = zone_index - ip; + if (address_part_size >= sizeof(address_part)) + address_part_size = sizeof(address_part) - 1; + memcpy(address_part, ip, address_part_size); + address_part[address_part_size] = '\0'; ip = address_part; zone_index++; /* skip '%' */ @@ -473,4 +474,5 @@ int uv__getaddrinfo_translate_error(int sys_err) { } assert(!"unknown EAI_* error code"); abort(); + return 0; /* Pacify compiler. */ } |