Skip to content
Snippets Groups Projects
Commit 730a00a1 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Bugfix in response - size and max size were short

parent a35822fb
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,8 @@ static int dnslib_response_init(dnslib_response_t *resp,
resp->max_size = resp->edns_response.payload;
}
debug_dnslib_response("Response max size: %zd\n", resp->max_size);
// pre-allocate space for wire format of the packet
resp->wireformat = (uint8_t *)malloc(resp->max_size);
if (resp->wireformat == NULL) {
......
......@@ -117,8 +117,8 @@ struct dnslib_response {
dnslib_opt_rr_t edns_response; /*!< EDNS data provided by the server.*/
uint8_t *wireformat; /*!< Wire format of the response. */
short size; /*!< Current wire size of the response. */
short max_size; /*!< Maximum allowed size of the response. */
int size; /*!< Current wire size of the response. */
int max_size; /*!< Maximum allowed size of the response. */
/*! \brief Information needed for compressing domain names in packet. */
dnslib_compressed_dnames_t compression;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment