Fix an invalid memory access detected by ASan stack-use-after-return.
The latest ASan from our compiler update (http://b/241011085) enables the stack-use-after-return check by default. This caught an issue in a Bluetooth test, where the test was initialized with an empty set of presets that are accidentally then iterated over starting with a direct access of the first nonexistent entry (lines 271-276 of has_client_test.cc). This fix switches the tests to use the default nullopt instead of an empty set, which then allows for a default set to be created before access. Bug: http://b/241963581 Test: atest --host bluetooth_has_test64 Change-Id: If500815340051f53890e4d751d9ad528bc1be2a2
Loading
Please register or sign in to comment