From f948445737c52a7d5206d52a256abe1ce2ce4199 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 10 Dec 2016 01:49:35 +0000 Subject: [PATCH] Fix binary compatibility of string conversion of RRs with internl addr tables Queries without adns__qtf_bigaddr use a smaller stride than the size of our own adns_rr_addr. This is dealt with by explicit calculation of the addr struct using the stride from gsz_addr. However, this circumlocution was omitted in cs_hostaddr, with the result that adns_rr_info would go wrong for old clients. Signed-off-by: Ian Jackson --- src/types.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types.c b/src/types.c index 0c4860d..b5f53c7 100644 --- a/src/types.c +++ b/src/types.c @@ -1007,6 +1007,7 @@ static adns_status csp_hostaddr(vbuf *vb, adns_rrtype rrt, adns_status st; char buf[20]; int i; + size_t addrsz= gsz_addr(0, rrt); st= csp_domain(vb,rrp->host); if (st) return st; @@ -1026,7 +1027,7 @@ static adns_status csp_hostaddr(vbuf *vb, adns_rrtype rrt, CSP_ADDSTR(" ("); for (i=0; inaddrs; i++) { CSP_ADDSTR(" "); - st= csp_addr(vb,&rrp->addrs[i]); + st= csp_addr(vb, (const void*)((const char*)rrp->addrs + addrsz*i)); } CSP_ADDSTR(" )"); } else { -- 2.30.2