From 0d5204e1a3ab21a18f153416e5a79cc6b899d2e9 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 29 Aug 2002 03:38:54 +0000 Subject: [PATCH] Fix possible buffer overflow --- libraries/libldap/dnssrv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/dnssrv.c b/libraries/libldap/dnssrv.c index fbd161b16a..72835f22e8 100644 --- a/libraries/libldap/dnssrv.c +++ b/libraries/libldap/dnssrv.c @@ -172,10 +172,11 @@ int ldap_domain2hostlist( char **list ) { #ifdef HAVE_RES_QUERY +#define DNSBUFSIZ (64*1024) char *request; char *hostlist = NULL; int rc, len, cur = 0; - unsigned char reply[1024]; + unsigned char reply[DNSBUFSIZ]; assert( domain != NULL ); assert( list != NULL ); @@ -198,7 +199,7 @@ int ldap_domain2hostlist( len = res_query(request, C_IN, T_SRV, reply, sizeof(reply)); if (len >= 0) { unsigned char *p; - char host[1024]; + char host[DNSBUFSIZ]; int status; u_short port; /* int priority, weight; */ -- 2.39.5