diff --git a/CHANGES b/CHANGES index 1e1bc5d..e6c0bd6 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ corrections: SIGSEGV and other signals could lead to a 100% CPU loop + Failing name resolution could lead to SIGSEGV + Thanks to Max for reporting this issue. + testing: socks4echo.sh and socks4a-echo.sh hung with new bash with read -n diff --git a/error.c b/error.c index 9e37f33..2b615d0 100644 --- a/error.c +++ b/error.c @@ -232,7 +232,7 @@ void msg(int level, const char *format, ...) { diag_flush(); } - if (level < diagopts.msglevel) { va_end(ap); return; } + if (level < diagopts.msglevel) { return; } va_start(ap, format); /* we do only a minimum in the outer parts which may run in a signal handler diff --git a/xio-ip.c b/xio-ip.c index 749c7a4..cd28f35 100644 --- a/xio-ip.c +++ b/xio-ip.c @@ -239,7 +239,8 @@ int xiogetaddrinfo(const char *node, const char *service, if ((error_num = Getaddrinfo(node, service, &hints, &res)) != 0) { Error7("getaddrinfo(\"%s\", \"%s\", {%d,%d,%d,%d}, {}): %s", - node, service, hints.ai_flags, hints.ai_family, + node?node:"NULL", service?service:"NULL", + hints.ai_flags, hints.ai_family, hints.ai_socktype, hints.ai_protocol, (error_num == EAI_SYSTEM)? strerror(errno):gai_strerror(error_num));