net: dns: Check parsing error properly for response
If the packet parsing fails in dns_unpack_response_query(), then do not continue further but bail out early. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
3c59bd4fb5
commit
eb2550a441
1 changed files with 5 additions and 0 deletions
|
@ -789,6 +789,11 @@ int dns_validate_msg(struct dns_resolve_context *ctx,
|
|||
|
||||
ret = dns_unpack_response_query(dns_msg);
|
||||
if (ret < 0) {
|
||||
if (ret == -ENOMEM) {
|
||||
ret = DNS_EAI_FAIL;
|
||||
goto quit;
|
||||
}
|
||||
|
||||
/* Check mDNS like above */
|
||||
if (*dns_id > 0) {
|
||||
ret = DNS_EAI_FAIL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue