]> git.puffer.fish Git - mirror/frr.git/commit
lib: fix incorrect thread management 9758/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 6 Oct 2021 14:35:07 +0000 (17:35 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 6 Oct 2021 16:13:12 +0000 (19:13 +0300)
commit72618ba82af966bbde6fda49905f6b2b6fa25fd0
treeed7d02431871bec8d4b56342e9220350b108ee0c
parent3f220bc814abeb11a17fad80f14c7ba79af67429
lib: fix incorrect thread management

The current code passes an address of a local variable to `thread_add_read`
which stores it into `thread->ref` by the lib. The next time the thread
callback is executed, the lib stores NULL into the `thread->ref` which
means it writes into some random memory on the stack.

To fix this, we should pass a pointer to the vector entry to the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/resolver.c
lib/vector.c
lib/vector.h