Skip to content
Commit 0f1d7d3b 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>
parent 2e484fc6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment