diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-04-14 13:54:24 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-04-14 13:54:54 +0200 |
commit | 44517bda3d8130638882f69478a8091316f30cbb (patch) | |
tree | 02d272bd02f4895f1e6c013f6522776ea433afa2 /xtoptions.c | |
parent | d44c31ac8e52f34e058f44aba14f679abcc7edf9 (diff) |
xtoptions: respect return value in xtables_getportbyname
If ret was negative, ntohs may make it positive, which is undesired.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtoptions.c')
-rw-r--r-- | xtoptions.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |