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

Commit c351f52a authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

DO NOT MERGE Handle GET_POWER failures

Return a failure when GET_POWER returns a non-conforming
format

Bug: 4380317
Change-Id: Ie723c424ab07774f2be2594aa5deeaa5cd5ac280
parent a8f6a0d9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -459,7 +459,9 @@ static jint android_net_wifi_getPowerModeCommand(JNIEnv* env, jobject clazz)
    }
    // reply comes back in the form "powermode = XX" where XX is the
    // number we're interested in.
    sscanf(reply, "%*s = %u", &power);
    if (sscanf(reply, "%*s = %u", &power) != 1) {
        return (jint)-1;
    }
    return (jint)power;
}