Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d45707d0 authored by Bernie Innocenti's avatar Bernie Innocenti
Browse files

Sanitize MDnsSdListener::Element::mRef.

The constructor of Element omits to clear mRef, and allocateServiceRef()
links it into the list in this half-initialized state. Given the current
code structure, this is harmless because we never de-reference mRef
until it's finally initialized, but it wasn't immediately obvious and
it's one tiny change away from becoming a nasty memory corruption bug.
So let's just clear it for peace of mind, especially since we don't have
asan on our side :-)

Also made the destructor non-virtual, since Element isn't used
polymorphically.

Test: m netd (for lack of better test coverage)
Change-Id: I6e65280ebb5cea80a0fea443d156f2e2e49ebd11
parent e072a3c0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment