From f62c5e576fd26e4e56f0304fe40b6a9f4ec86537 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 2 Jun 2012 01:07:22 +0100 Subject: [PATCH] put a missing ntohs back --- helper.c | 2 +- libauthbind.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helper.c b/helper.c index 77456c1..cc4efe2 100644 --- a/helper.c +++ b/helper.c @@ -134,7 +134,7 @@ int main(int argc, const char *const *argv) { if (errno != ENOENT) exiterrno(errno); char npbuf[INET_ADDRSTRLEN + INET6_ADDRSTRLEN]; - np= inet_ntop(af,addr_any,npbuf,addrlen_any); + np= inet_ntop(af,addr_any,npbuf,sizeof(npbuf)); assert(np); if (af == AF_INET) { diff --git a/libauthbind.c b/libauthbind.c index d63bc97..a685ce3 100644 --- a/libauthbind.c +++ b/libauthbind.c @@ -164,7 +164,7 @@ int bind(int fd, const struct sockaddr *addr, socklen_t addrlen) { goto bail; } - if (!geteuid() || portval == 0 || portval >= IPPORT_RESERVED) { + if (!geteuid() || portval == 0 || ntohs(portval) >= IPPORT_RESERVED) { bail: return old_bind(fd,addr,addrlen); } -- 2.30.2