From 8ec3f656d6edf6f16216105131fc8b0542216a5b Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 11 Nov 2013 12:24:42 +0100 Subject: Fix off-by-one in nscd getservbyport call --- nscd/nscd_getserv_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nscd') diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c index c9c890c..7728258 100644 --- a/nscd/nscd_getserv_r.c +++ b/nscd/nscd_getserv_r.c @@ -54,7 +54,7 @@ __nscd_getservbyport_r (int port, const char *proto, portstr[sizeof (portstr) - 1] = '\0'; char *cp = _itoa_word (port, portstr + sizeof (portstr) - 1, 10, 0); - return nscd_getserv_r (cp, portstr + sizeof (portstr) - cp, proto, + return nscd_getserv_r (cp, portstr + sizeof (portstr) - 1 - cp, proto, GETSERVBYPORT, result_buf, buf, buflen, result); } -- cgit v1.1