9832fd
commit 8ec3f656d6edf6f16216105131fc8b0542216a5b
9832fd
Author: Andreas Schwab <schwab@suse.de>
9832fd
Date:   Mon Nov 11 12:24:42 2013 +0100
9832fd
9832fd
    Fix off-by-one in nscd getservbyport call
9832fd
9832fd
diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c
9832fd
index c9c890c..7728258 100644
9832fd
--- a/nscd/nscd_getserv_r.c
9832fd
+++ b/nscd/nscd_getserv_r.c
9832fd
@@ -54,7 +54,7 @@ __nscd_getservbyport_r (int port, const char *proto,
9832fd
   portstr[sizeof (portstr) - 1] = '\0';
9832fd
   char *cp = _itoa_word (port, portstr + sizeof (portstr) - 1, 10, 0);
9832fd
 
9832fd
-  return nscd_getserv_r (cp, portstr + sizeof (portstr) - cp, proto,
9832fd
+  return nscd_getserv_r (cp, portstr + sizeof (portstr) - 1 - cp, proto,
9832fd
 			 GETSERVBYPORT, result_buf, buf, buflen, result);
9832fd
 }
9832fd