From 44517bda3d8130638882f69478a8091316f30cbb Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 14 Apr 2011 13:54:24 +0200 Subject: [PATCH] xtoptions: respect return value in xtables_getportbyname If ret was negative, ntohs may make it positive, which is undesired. Signed-off-by: Jan Engelhardt --- xtoptions.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.47.3