mirror of https://github.com/getdnsapi/getdns.git
Don't transmit an extra NULL byte in the anchor fetch HTTP request
When calculating HTTP request buffer size tas_connect() unnecessarily adds an extra octet for the terminating NULL byte. The terminating NULL was already accounted for by sizeof(fmt), however, since sizeof("123") = 4. The extra NULL byte at the end of the anchor fetch HTTP request resulted in an extra "501 Not implemented" HTTP response from the trust anchor server.
This commit is contained in:
parent
99e32f1e46
commit
0a1883047d
|
@ -1086,11 +1086,11 @@ static void tas_connect(getdns_context *context, tas_connection *a)
|
|||
}
|
||||
if (a->state == TAS_RETRY_GET_PS7) {
|
||||
buf_sz = sizeof(tas_write_p7s_buf)
|
||||
+ 1 * (hostname_len - 2) + 1 * (path_len - 2) + 1;
|
||||
+ 1 * (hostname_len - 2) + 1 * (path_len - 2);
|
||||
fmt = tas_write_p7s_buf;
|
||||
} else {
|
||||
buf_sz = sizeof(tas_write_xml_p7s_buf)
|
||||
+ 2 * (hostname_len - 2) + 2 * (path_len - 2) + 1;
|
||||
+ 2 * (hostname_len - 2) + 2 * (path_len - 2);
|
||||
fmt = tas_write_xml_p7s_buf;
|
||||
}
|
||||
if (!(write_buf = GETDNS_XMALLOC(context->mf, char, buf_sz))) {
|
||||
|
|
Loading…
Reference in New Issue