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
Loading
Please register or sign in to comment