summaryrefslogtreecommitdiffstats
path: root/rfc1035/testlookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'rfc1035/testlookup.c')
-rw-r--r--rfc1035/testlookup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/rfc1035/testlookup.c b/rfc1035/testlookup.c
index 75c701f..869e806 100644
--- a/rfc1035/testlookup.c
+++ b/rfc1035/testlookup.c
@@ -312,8 +312,13 @@ char ptrbuf[RFC1035_MAXNAMESIZE+1];
{
char namebuf[RFC1035_MAXNAMESIZE+1];
- namebuf[0]=0;
- strncat(namebuf, q_name, RFC1035_MAXNAMESIZE);
+ size_t l=strlen(q_name);
+
+ if (l > RFC1035_MAXNAMESIZE)
+ l=RFC1035_MAXNAMESIZE;
+
+ memcpy(namebuf, q_name, l);
+ namebuf[l]=0;
if (rfc1035_resolve_cname_multiple(&res, namebuf,
q_type, q_class,