summaryrefslogtreecommitdiff
path: root/python/firstheader.py
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-11-07 15:41:18 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2021-11-08 14:06:21 +0100
commitfaf079ff7e835bd454dda0804e677c477489b3ed (patch)
treed0db963ebb2ab1837af10e2d999fd01f2e808af9 /python/firstheader.py
parent2d5b7a5b46272de149c93dc70778bce19e67b01d (diff)
lib: fix c-ares thread misuse
The `struct thread **ref` that the thread code takes is written to and needs to stay valid over the lifetime of a thread. This does not hold up if thread pointers are directly put in a `vector` since adding items to a `vector` may reallocate the entire array. The thread code would then write to a now-invalid `ref`, potentially corrupting entirely unrelated data. This should be extremely rare to trigger in practice since we only use one c-ares channel, which will likely only ever use one fd, so the vector is never resized. That said, c-ares using only one fd is just plain fragile luck. Either way, fix this by creating a resolver_fd tracking struct, and clean up the code while we're at it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'python/firstheader.py')
0 files changed, 0 insertions, 0 deletions