Index: net/shadowsocks-libev/Makefile =================================================================== --- net/shadowsocks-libev/Makefile +++ net/shadowsocks-libev/Makefile @@ -13,15 +13,13 @@ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN_powerpc64= fails to link: cc: Internal error: Segmentation fault (program ld) - LIB_DEPENDS= libev.so:devel/libev \ libmbedcrypto.so:security/mbedtls \ libpcre.so:devel/pcre \ libsodium.so:security/libsodium \ libcares.so:dns/c-ares -USES= autoreconf gmake libtool:keepla pathfix +USES= autoreconf compiler:c11 gmake libtool:keepla pathfix GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-shared USE_GITHUB= yes Index: net/shadowsocks-libev/files/patch-src_manager.c =================================================================== --- /dev/null +++ net/shadowsocks-libev/files/patch-src_manager.c @@ -0,0 +1,38 @@ +--- src/manager.c.orig 2018-01-16 01:25:03 UTC ++++ src/manager.c +@@ -278,13 +278,13 @@ get_server(char *buf, int len) + json_value *value = obj->u.object.values[i].value; + if (strcmp(name, "server_port") == 0) { + if (value->type == json_string) { +- strncpy(server->port, value->u.string.ptr, 8); ++ strncpy(server->port, value->u.string.ptr, 7); + } else if (value->type == json_integer) { + snprintf(server->port, 8, "%" PRIu64 "", value->u.integer); + } + } else if (strcmp(name, "password") == 0) { + if (value->type == json_string) { +- strncpy(server->password, value->u.string.ptr, 128); ++ strncpy(server->password, value->u.string.ptr, 127); + } + } else if (strcmp(name, "method") == 0) { + if (value->type == json_string) { +@@ -341,7 +341,7 @@ parse_traffic(char *buf, int len, char *port, uint64_t + char *name = obj->u.object.values[i].name; + json_value *value = obj->u.object.values[i].value; + if (value->type == json_integer) { +- strncpy(port, name, 8); ++ strncpy(port, name, 7); + *traffic = value->u.integer; + } + } +@@ -1145,8 +1145,8 @@ main(int argc, char **argv) + for (i = 0; i < conf->port_password_num; i++) { + struct server *server = ss_malloc(sizeof(struct server)); + memset(server, 0, sizeof(struct server)); +- strncpy(server->port, conf->port_password[i].port, 8); +- strncpy(server->password, conf->port_password[i].password, 128); ++ strncpy(server->port, conf->port_password[i].port, 7); ++ strncpy(server->password, conf->port_password[i].password, 127); + add_server(&manager, server); + } + } Index: net/shadowsocks-libev/files/patch-src_netutils.c =================================================================== --- /dev/null +++ net/shadowsocks-libev/files/patch-src_netutils.c @@ -0,0 +1,11 @@ +--- src/netutils.c.orig 2018-01-16 01:25:03 UTC ++++ src/netutils.c +@@ -79,7 +79,7 @@ setinterface(int socket_fd, const char *interface_name + { + struct ifreq interface; + memset(&interface, 0, sizeof(struct ifreq)); +- strncpy(interface.ifr_name, interface_name, IFNAMSIZ); ++ strncpy(interface.ifr_name, interface_name, IFNAMSIZ-1); + int res = setsockopt(socket_fd, SOL_SOCKET, SO_BINDTODEVICE, &interface, + sizeof(struct ifreq)); + return res; Index: net/shadowsocks-libev/files/patch-src_server.c =================================================================== --- /dev/null +++ net/shadowsocks-libev/files/patch-src_server.c @@ -0,0 +1,11 @@ +--- src/server.c.orig 2019-04-25 15:38:42 UTC ++++ src/server.c +@@ -751,7 +751,7 @@ server_recv_cb(EV_P_ ev_io *w, int revents) + int offset = 0; + int need_query = 0; + char atyp = server->buf->data[offset++]; +- char host[257] = { 0 }; ++ char host[255] = { 0 }; + uint16_t port = 0; + struct addrinfo info; + struct sockaddr_storage storage;