- Final round of DoH review feedback processing.

This commit is contained in:
Ralph Dolmans
2020-09-16 18:25:02 +02:00
parent a3be2b73b6
commit 42a35ac26e
9 changed files with 43 additions and 37 deletions
+9 -2
View File
@@ -171,8 +171,9 @@ submit_query(struct http2_session* h2_session, struct sldns_buffer* buf)
h2_stream->path = malloc(strlen(
h2_session->endpoint)+strlen("?dns=")+qb64_size+1);
if(!h2_stream->path) fatal_exit("out of memory");
sprintf(h2_stream->path, "%s?dns=%s", h2_session->endpoint,
qb64);
snprintf(h2_stream->path, strlen(h2_session->endpoint)+
strlen("?dns=")+qb64_size+1, "%s?dns=%s",
h2_session->endpoint, qb64);
free(qb64);
}
@@ -328,6 +329,11 @@ static int http2_data_chunk_recv_cb(nghttp2_session* ATTR_UNUSED(session),
return 0;
}
if(sldns_buffer_remaining(h2_stream->buf) < len) {
log_err("received data chunck does not fit into buffer");
return NGHTTP2_ERR_CALLBACK_FAILURE;
}
sldns_buffer_write(h2_stream->buf, data, len);
return 0;
@@ -575,5 +581,6 @@ int main(int argc, char** argv)
int main(int ATTR_UNUSED(argc), char** ATTR_UNUSED(argv))
{
printf("Compiled without nghttp2, cannot run test.\n");
return 1;
}
#endif /* HAVE_NGHTTP2 */