about summary refs log tree commit diff
path: root/nscd
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2013-11-11 12:24:42 +0100
committerAndreas Schwab <schwab@suse.de>2013-11-11 12:26:32 +0100
commit8ec3f656d6edf6f16216105131fc8b0542216a5b (patch)
tree25930564f7938815cc886d5b5d6f355a7c1f6a75 /nscd
parent43d5c02c72bdaf59a8e0d4b06f2ae87e42269cbd (diff)
downloadglibc-8ec3f656d6edf6f16216105131fc8b0542216a5b.tar.gz
glibc-8ec3f656d6edf6f16216105131fc8b0542216a5b.tar.xz
glibc-8ec3f656d6edf6f16216105131fc8b0542216a5b.zip
Fix off-by-one in nscd getservbyport call
Diffstat (limited to 'nscd')
-rw-r--r--nscd/nscd_getserv_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c
index c9c890c63c..772825854d 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);
 }