Handle GET_POWER failures
Return a failure when GET_POWER returns a non-conforming format Bug: 4380317 Change-Id: If1ce73572ae261cd6998e4289e21112c88859437
This commit is contained in:
@@ -402,7 +402,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user