summaryrefslogtreecommitdiffstats
path: root/tcpd/tcpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcpd/tcpd.c')
-rw-r--r--tcpd/tcpd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tcpd/tcpd.c b/tcpd/tcpd.c
index 0fd0398..7cd3afa 100644
--- a/tcpd/tcpd.c
+++ b/tcpd/tcpd.c
@@ -1605,9 +1605,13 @@ static void docheckblocklist(struct blocklist_s *p, const char *nameptr)
int found;
unsigned char query_A[] = {RFC1035_TYPE_A, 0},
query_A_and_TXT[] = {RFC1035_TYPE_A, RFC1035_TYPE_TXT, 0};
+ size_t l=strlen(nameptr);
- hostname[0]=0;
- strncat(hostname, nameptr, RFC1035_MAXNAMESIZE);
+ if (l > RFC1035_MAXNAMESIZE)
+ l=RFC1035_MAXNAMESIZE;
+
+ memcpy(hostname, nameptr, l);
+ hostname[l]=0;
if (!varname) varname="BLOCK";