Merge "Fix loop iteration bug."
am: 1a74681173
Change-Id: I0f01f27d328b242cf8c102bbfe70324d9d263ce9
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 3012c90..f83f2d0 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -1115,8 +1115,8 @@
RuntimeAbort(env, __LINE__, "Bad gids array");
}
- for (int gid_index = gids_num; --gids_num >= 0;) {
- if (native_gid_proxy[gid_index] == AID_WAKELOCK) {
+ for (int gids_index = 0; gids_index < gids_num; ++gids_index) {
+ if (native_gid_proxy[gids_index] == AID_WAKELOCK) {
gid_wakelock_found = true;
break;
}