mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
dns_core: Allow zero-length DNS responses.
A testsuite test recently failed due to a crash that occurred in the DNS core. The problem was that the test could not resolve an address, did not set a result on the DNS query, and then indicated the query was completed. The DNS core does not handle the case of a query with no result gracefully, and so there is a crash. This changeset makes the DNS system resolver set a result with a zero-length answer in the case that a DNS resolution failure occurs early. The DNS core now also will accept such a response without treating it as invalid input. A unit test was updated to no longer treat setting a zero-length response as off-nominal. Change-Id: Ie56641e22debdaa61459e1c9a042e23b78affbf6
This commit is contained in:
@@ -90,6 +90,10 @@ void *ast_dns_resolver_get_data(const struct ast_dns_query *query);
|
||||
* \param answer The raw DNS answer
|
||||
* \param answer_size The size of the raw DNS answer
|
||||
*
|
||||
* Zero-sized and NULL answers are permitted by this function. This may be
|
||||
* necessary if the query fails at an early stage and no actual DNS response
|
||||
* has been received from a DNS server.
|
||||
*
|
||||
* \retval 0 success
|
||||
* \retval -1 failure
|
||||
*/
|
||||
|
Reference in New Issue
Block a user