aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dnsbase.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dnsbase.c b/src/dnsbase.c
index 7290fc46..777ca7ee 100644
--- a/src/dnsbase.c
+++ b/src/dnsbase.c
@@ -606,11 +606,13 @@ a_lookup(const char *host,
unsigned long *ttl, char *answer, size_t answer_size)
{
struct loop_data ld;
- char domainbuf[256] = "";
+ char namebuf[NSIZE];
+ char domainbuf[NSIZE] = "";
ld.qtype = ld.atype = T_A;
- ld.name = xstrdup(host);
- ld.name_size = strlen(ld.name);
+ strncpy(namebuf, host, sizeof namebuf - 1);
+ ld.name = namebuf;
+ ld.name_size = sizeof namebuf;
ld.domain = domainbuf;
ld.domain_size = sizeof domainbuf;
ld.answer = answer;
@@ -623,7 +625,6 @@ a_lookup(const char *host,
ld.loopcnt = MAXCNAMEDEPTH;
cnameloop(&ld);
- free(ld.name);
if (ld.status == dns_success) {
if (ipcount)
*ipcount = ld.hbcount;

Return to:

Send suggestions and report system problems to the System administrator.