From: ian Date: Wed, 16 Jun 1999 23:15:55 +0000 (+0000) Subject: In adnstest, allocate enough space for, and terminate, query types. X-Git-Tag: rel-adns-0-3~15 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=e3d42241720a620b3baf051b4185d906d00e3e54 In adnstest, allocate enough space for, and terminate, query types. --- 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);