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
* Bugfix getdnsapi/stubby#106: Core dump when printing certain
configuration. Thanks Han Vinke
* Bugfix getdnsapi/stubby#99: Partly trace DNSSEC from the root
up (for tld and sld), to find insecure delegations quicker.
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 base64str_sz;
char *target;
size_t avail;
if (gldns_buffer_printf(buf, " <bindata of ") < 0)
return -1;
base64str_sz = gldns_b64_ntop_calculate_size(bindata->size);
target = (char *)gldns_buffer_current(buf);
avail = gldns_buffer_remaining(buf);
if (avail >= base64str_sz)
gldns_buffer_skip(buf, gldns_b64_ntop(
bindata->data, bindata->size,
target, base64str_sz));
else
gldns_buffer_skip(buf, base64str_sz);
if (!gldns_buffer_reserve(buf, base64str_sz))
return -1;
gldns_buffer_skip(buf, gldns_b64_ntop(bindata->data, bindata->size,
(char *)gldns_buffer_current(buf), base64str_sz));
if (gldns_buffer_printf(buf, ">") < 0)
return -1;