arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1634021.patch

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