From e9edd7c3b57b3db9b85ff7ddde4593b19d5ea176 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 29 Sep 2000 10:59:14 +1100 Subject: [PATCH] - (djm) Another off-by-one fix from Pavel Kankovsky --- CREDITS | 1 + fake-getnameinfo.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 0bae5a1a5..78ce2d697 100644 --- a/CREDITS +++ b/CREDITS @@ -57,6 +57,7 @@ Michael Stone - Irix enhancements Nalin Dahyabhai - PAM environment patch Nate Itkin - SunOS 4.1.x fixes Niels Kristian Bech Jensen - Assorted patches +Pavel Kankovsky - Security fixes Pavel Troller - Bugfixes Pekka Savola - Bugfixes Peter Kocks - Makefile fixes diff --git a/fake-getnameinfo.c b/fake-getnameinfo.c index ce992d111..203621f0d 100644 --- a/fake-getnameinfo.c +++ b/fake-getnameinfo.c @@ -22,7 +22,7 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, if (serv) { snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port)); - if (strlen(tmpserv) > servlen) + if (strlen(tmpserv) >= servlen) return EAI_MEMORY; else strcpy(serv, tmpserv);