Bugfix getdnsapi/stubby#106: Core dump when ...

printing certain configuration. Thanks Han Vinke
This commit is contained in:
Willem Toorop 2018-05-11 11:28:52 +02:00
parent 98b1ff624a
commit 6c99e7b8a6
2 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,6 @@
* 2018-05-??: Version 1.4.2 * 2018-05-??: Version 1.4.2
* Bugfix getdnsapi/stubby#106: Core dump when printing certain
configuration. Thanks Han Vinke
* Bugfix getdnsapi/stubby#99: Partly trace DNSSEC from the root * Bugfix getdnsapi/stubby#99: Partly trace DNSSEC from the root
up (for tld and sld), to find insecure delegations quicker. up (for tld and sld), to find insecure delegations quicker.
Thanks UniverseXXX Thanks UniverseXXX

View File

@ -737,21 +737,16 @@ getdns_pp_base64(gldns_buffer *buf, getdns_bindata *bindata)
{ {
size_t p = gldns_buffer_position(buf); size_t p = gldns_buffer_position(buf);
size_t base64str_sz; size_t base64str_sz;
char *target;
size_t avail;
if (gldns_buffer_printf(buf, " <bindata of ") < 0) if (gldns_buffer_printf(buf, " <bindata of ") < 0)
return -1; return -1;
base64str_sz = gldns_b64_ntop_calculate_size(bindata->size); base64str_sz = gldns_b64_ntop_calculate_size(bindata->size);
target = (char *)gldns_buffer_current(buf); if (!gldns_buffer_reserve(buf, base64str_sz))
avail = gldns_buffer_remaining(buf); return -1;
if (avail >= base64str_sz)
gldns_buffer_skip(buf, gldns_b64_ntop( gldns_buffer_skip(buf, gldns_b64_ntop(bindata->data, bindata->size,
bindata->data, bindata->size, (char *)gldns_buffer_current(buf), base64str_sz));
target, base64str_sz));
else
gldns_buffer_skip(buf, base64str_sz);
if (gldns_buffer_printf(buf, ">") < 0) if (gldns_buffer_printf(buf, ">") < 0)
return -1; return -1;