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

Commit 339c9866 authored by Yifan Hong's avatar Yifan Hong
Browse files

Fix segfault.

Fix code that incorrectly transforms a hidl_string to String8
by using size of another field.

Test: none
Fixes: 161210887
Change-Id: I54a11e9beab4c825905dda37b121e1fc85658215
parent 7cac9425
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ void convertFromHealthConfig(const HealthConfig& c, struct healthd_config *hc) {

    hc->batteryCurrentAvgPath =
        android::String8(c.batteryCurrentAvgPath.c_str(),
                         c.batteryCurrentNowPath.size());
                         c.batteryCurrentAvgPath.size());

    hc->batteryChargeCounterPath =
        android::String8(c.batteryChargeCounterPath.c_str(),