Validate that the file descriptor is not a negative number before writing to the `dispatch_table` `ctx` field. Setting file descriptors to `-1` is the standard "not in use" value, and in fact the entire array of `fds` is set to this value in `dns_resolve_init_locked`. This resolves memory corruption of whichever variable is unfortunate to exist just before `dispatch_table` in memory. Signed-off-by: Jordan Yates <jordan@embeint.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| dispatcher.c | ||
| dns_cache.c | ||
| dns_cache.h | ||
| dns_internal.h | ||
| dns_pack.c | ||
| dns_pack.h | ||
| dns_sd.c | ||
| dns_sd.h | ||
| Kconfig | ||
| llmnr_responder.c | ||
| mdns_responder.c | ||
| resolve.c | ||