commit | fc3b35f7b391d7917d54b0c9fa331c5daf408702 | [log] [tgz] |
---|---|---|
author | Jonathan Basseri <misterikkit@google.com> | Thu Sep 14 15:58:16 2017 -0700 |
committer | Jonathan Basseri <misterikkit@google.com> | Thu Sep 14 18:16:12 2017 -0700 |
tree | de8532e251f21b27f603617d73822537e4bdfdfa | |
parent | c61286619ff79895129b26e0cc14a6c43aff960d [diff] |
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