Skip to content
Commit a6bf101d authored by Jordan Yates's avatar Jordan Yates Committed by Benjamin Cabé
Browse files

net: dns: dispatcher: fix OOB array access



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: default avatarJordan Yates <jordan@embeint.com>
(cherry picked from commit 0f1d7d3b)
parent e0f92e37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment