forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenThread] Harden DNS record parsing (project-chip#31227)
OpenThread applications would crash upon receiving an empty DNS TXT record. The reason was that the code for copying OT DNS service info object into Matter DnssdService object would not initialize the TXT entry count in the latter object in such a case. In the reported case, the Matter stack was presented an empty TXT record because OpenThread's DNS client received a TXT record with TTL 0 and it discarded its contents. Nevertheless, the issue could be reproduced by publishing Matter service without TXT entries and kicking off DNS query. 1. Initialize the TXT entry and subtype count properly in all scenarios. 2. Do not even process the service info object if an error was returned by OpenThread before. 3. Extract some boilerplate to a separate function to improve readability. Signed-off-by: Damian Krolik <[email protected]>
- Loading branch information
1 parent
d2de5d5
commit 76b6bb5
Showing
1 changed file
with
35 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters