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

Skip to content
Commit fc3b35f7 authored by Jonathan Basseri's avatar Jonathan Basseri
Browse files

Fix use-after-free in XfrmControllerTest.

The test was capturing 'optval' and 'optlen' from setsockopt calls, but
by the time the code under test has returned, the memory pointed to by
optval is no longer valid.  Update the test to copy the data before it
is too late.

If you are confused about how the gTest API is used here, look at
SaveArg and SaveArgPointee here:
https://github.com/google/googletest/blob/master/googlemock/docs/CheatSheet.md#side-effects

Bug: 65495297
Test: runtest -x system/netd/server/netd_unit_test.cpp
Change-Id: I490485dc8e1ef3569234653fa63af1c6409c075e
parent c6128661
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