shill: remove pointer cast in getter in WiFiService::Load
Remove the uint64_t pointer up-casting in WiFiService::Load, which is causing
members adjacent to |roam_threshold_db_| in memory to be overwritten by the call
to the GetUint64 getter function. Instead, store the uint64_t retrieved by this
function in a temporary, then later narrow this temporary variable (using
static_cast) when saving it into |roam_threshold_db_|.
BUG=chromium:477950
TEST=Compile shill and run unit tests.
Manual test instructions:
1) Flash image onto an ARM-based chrome OS device (e.g. daisy-spring) and boot
into it.
2) Make sure ethernet is disconnected, and connect to a WiFi network.
3) Run '/usr/local/lib/flimflam/test/list-active-service' and ensure that the
WiFi network you connected to is the only active service, and that its
WiFi.RoamThreshold property is 0. Note the service number (e.g. if the WiFi
service is named /service/24, the service number is 24).
4) Run
dbus-send --system --print-reply --dest=org.chromium.flimflam /service/$X \
org.chromium.flimflam.Service.SetProperty string:WiFi.RoamThreshold \
variant:uint16:70
where $X is the service number observed in step 3.
5) Repeat step 3 and verify that WiFi.RoamThreshold is now 70.
6) Run 'grep -iR SEGV /var/log/messages | wc -l' and ensure that the output is
0.
7) Run 'restart shill'.
8) Repeat step 6, and ensure that the output is still 0.
Change-Id: I5727dc109301388e7cf5dc5c7f58bf69c5259ba0
Reviewed-on: https://chromium-review.googlesource.com/266604
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
1 file changed