From e3d42241720a620b3baf051b4185d906d00e3e54 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 16 Jun 1999 23:15:55 +0000 Subject: [PATCH] In adnstest, allocate enough space for, and terminate, query types. --- client/adnstest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/adnstest.c b/client/adnstest.c index 4f2b982..6c2fc61 100644 --- a/client/adnstest.c +++ b/client/adnstest.c @@ -99,7 +99,7 @@ int main(int argc, char *const *argv) { if (argv[0] && argv[1] && argv[1][0] == ':') { for (cp= argv[1]+1, tc=1; (ch= *cp); cp++) if (ch==',') tc++; - types_a= malloc(sizeof(*types_a)*tc); + types_a= malloc(sizeof(*types_a)*(tc+1)); if (!types_a) { perror("malloc types"); exit(3); } for (cp= argv[1]+1, ti=0; tinrrs) { assert(!ri); for (i=0; inrrs; i++) { - r= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes+i*len,&show); + r= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes + i*len, &show); if (r) failure("info",r); fprintf(stdout," %s\n",show); free(show); -- 2.11.0