mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
When saving the query message (for SIG(0) or update forwarding), don't actually
do an allocate and copy, since the input buffer stays around.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: message.c,v 1.166 2001/01/04 00:24:26 bwelling Exp $ */
|
/* $Id: message.c,v 1.167 2001/01/04 01:55:22 bwelling Exp $ */
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Imports
|
*** Imports
|
||||||
@@ -558,13 +558,11 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg->query.base != NULL) {
|
if (msg->query.base != NULL) {
|
||||||
isc_mem_put(msg->mctx, msg->query.base, msg->query.length);
|
|
||||||
msg->query.base = NULL;
|
msg->query.base = NULL;
|
||||||
msg->query.length = 0;
|
msg->query.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->saved.base != NULL) {
|
if (msg->saved.base != NULL) {
|
||||||
isc_mem_put(msg->mctx, msg->saved.base, msg->saved.length);
|
|
||||||
msg->saved.base = NULL;
|
msg->saved.base = NULL;
|
||||||
msg->saved.length = 0;
|
msg->saved.length = 0;
|
||||||
}
|
}
|
||||||
@@ -1540,14 +1538,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
|
|||||||
r.length);
|
r.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_buffer_usedregion(&origsource, &r);
|
isc_buffer_usedregion(&origsource, &msg->saved);
|
||||||
msg->saved.length = r.length;
|
|
||||||
msg->saved.base = isc_mem_get(msg->mctx, msg->saved.length);
|
|
||||||
if (msg->saved.base == NULL) {
|
|
||||||
msg->saved.length = 0;
|
|
||||||
return (ISC_R_NOMEMORY);
|
|
||||||
}
|
|
||||||
memcpy(msg->saved.base, r.base, msg->saved.length);
|
|
||||||
|
|
||||||
if (seen_problem == ISC_TRUE)
|
if (seen_problem == ISC_TRUE)
|
||||||
return (DNS_R_RECOVERABLE);
|
return (DNS_R_RECOVERABLE);
|
||||||
|
Reference in New Issue
Block a user