mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
query could be tested uninitialised, check the result of dns_message_create
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: gsstest.c,v 1.16 2011/03/28 05:14:51 marka Exp $ */
|
/* $Id: gsstest.c,v 1.17 2011/08/29 23:21:48 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -146,14 +146,14 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
|
|||||||
|
|
||||||
REQUIRE(reqev != NULL);
|
REQUIRE(reqev != NULL);
|
||||||
|
|
||||||
|
query = reqev->ev_arg;
|
||||||
|
|
||||||
if (reqev->result != ISC_R_SUCCESS) {
|
if (reqev->result != ISC_R_SUCCESS) {
|
||||||
fprintf(stderr, "I:request event result: %s\n",
|
fprintf(stderr, "I:request event result: %s\n",
|
||||||
isc_result_totext(reqev->result));
|
isc_result_totext(reqev->result));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
query = reqev->ev_arg;
|
|
||||||
|
|
||||||
response = NULL;
|
response = NULL;
|
||||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &response);
|
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &response);
|
||||||
CHECK("dns_message_create", result);
|
CHECK("dns_message_create", result);
|
||||||
@@ -220,6 +220,8 @@ sendquery(isc_task_t *task, isc_event_t *event)
|
|||||||
CHECK("dns_name_fromtext", result);
|
CHECK("dns_name_fromtext", result);
|
||||||
|
|
||||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &message);
|
result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &message);
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
goto end;
|
||||||
|
|
||||||
message->opcode = dns_opcode_query;
|
message->opcode = dns_opcode_query;
|
||||||
message->rdclass = dns_rdataclass_in;
|
message->rdclass = dns_rdataclass_in;
|
||||||
@@ -280,14 +282,14 @@ initctx2(isc_task_t *task, isc_event_t *event) {
|
|||||||
|
|
||||||
REQUIRE(reqev != NULL);
|
REQUIRE(reqev != NULL);
|
||||||
|
|
||||||
|
query = reqev->ev_arg;
|
||||||
|
|
||||||
if (reqev->result != ISC_R_SUCCESS) {
|
if (reqev->result != ISC_R_SUCCESS) {
|
||||||
fprintf(stderr, "I:request event result: %s\n",
|
fprintf(stderr, "I:request event result: %s\n",
|
||||||
isc_result_totext(reqev->result));
|
isc_result_totext(reqev->result));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
query = reqev->ev_arg;
|
|
||||||
|
|
||||||
response = NULL;
|
response = NULL;
|
||||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &response);
|
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &response);
|
||||||
CHECK("dns_message_create", result);
|
CHECK("dns_message_create", result);
|
||||||
|
Reference in New Issue
Block a user