Commit 0d5204e1 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix possible buffer overflow

parent 1ed279ca
...@@ -172,10 +172,11 @@ int ldap_domain2hostlist( ...@@ -172,10 +172,11 @@ int ldap_domain2hostlist(
char **list ) char **list )
{ {
#ifdef HAVE_RES_QUERY #ifdef HAVE_RES_QUERY
#define DNSBUFSIZ (64*1024)
char *request; char *request;
char *hostlist = NULL; char *hostlist = NULL;
int rc, len, cur = 0; int rc, len, cur = 0;
unsigned char reply[1024]; unsigned char reply[DNSBUFSIZ];
assert( domain != NULL ); assert( domain != NULL );
assert( list != NULL ); assert( list != NULL );
...@@ -198,7 +199,7 @@ int ldap_domain2hostlist( ...@@ -198,7 +199,7 @@ int ldap_domain2hostlist(
len = res_query(request, C_IN, T_SRV, reply, sizeof(reply)); len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
if (len >= 0) { if (len >= 0) {
unsigned char *p; unsigned char *p;
char host[1024]; char host[DNSBUFSIZ];
int status; int status;
u_short port; u_short port;
/* int priority, weight; */ /* int priority, weight; */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment