diff options
| author | Sam Varshavchik | 2021-05-21 21:11:51 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2021-05-21 21:11:51 -0400 |
| commit | 142f42378608e593eb36ceb33895db99948427aa (patch) | |
| tree | fc089285268a8fe3c8768cd7482fb50393f49354 /rfc1035/testlookup.c | |
| parent | 34b6dbb743654fdb6edccf101c4da7e671b7a92d (diff) | |
| download | courier-libs-142f42378608e593eb36ceb33895db99948427aa.tar.bz2 | |
-Wall and -Werror fixes
Diffstat (limited to 'rfc1035/testlookup.c')
| -rw-r--r-- | rfc1035/testlookup.c | 9 |
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, |
