From: Jan Engelhardt Date: Thu, 14 Apr 2011 11:54:24 +0000 (+0200) Subject: xtoptions: respect return value in xtables_getportbyname X-Git-Tag: v1.4.11~19^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44517bda3d8130638882f69478a8091316f30cbb;p=thirdparty%2Fiptables.git xtoptions: respect return value in xtables_getportbyname If ret was negative, ntohs may make it positive, which is undesired. Signed-off-by: Jan Engelhardt --- diff --git a/xtoptions.c b/xtoptions.c index c3cc40e6..8478d26d 100644 --- a/xtoptions.c +++ b/xtoptions.c @@ -379,6 +379,8 @@ static int xtables_getportbyname(const char *name) } } freeaddrinfo(res); + if (ret < 0) + return ret; return ntohs(ret); }