summaryrefslogtreecommitdiffstats
path: root/core/java/android/database
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2015-05-29 18:48:38 -0700
committerJeff Brown <jeffbrown@google.com>2015-06-01 16:33:24 -0700
commitbb8c841e909a2fb967db2ad3b9f8b058f9b849e8 (patch)
tree5cae1a1cd4025f6f1d8c4cdc4f52f65d96c5994c /core/java/android/database
parent765389ec4f7df86cc8f74258a087fc8b8f6f8a7e (diff)
downloadframeworks_base-bb8c841e909a2fb967db2ad3b9f8b058f9b849e8.zip
frameworks_base-bb8c841e909a2fb967db2ad3b9f8b058f9b849e8.tar.gz
frameworks_base-bb8c841e909a2fb967db2ad3b9f8b058f9b849e8.tar.bz2
Terminate loop properly when cursor window is full.
The existing code exits the column-filling loop immediately but may continue to try to fill rows. Ordinarily this should fail too but it's possible for the process to continue and then blow up a little later. Fixed this problem by exiting the row- filling loop promptly. Bug: 21406130 Change-Id: Ifab59188d5d1b40f3c1f5c97604dd48da71bf37b
Diffstat (limited to 'core/java/android/database')
-rw-r--r--core/java/android/database/DatabaseUtils.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/database/DatabaseUtils.java b/core/java/android/database/DatabaseUtils.java
index e61664c..227066d 100644
--- a/core/java/android/database/DatabaseUtils.java
+++ b/core/java/android/database/DatabaseUtils.java
@@ -270,7 +270,7 @@ public class DatabaseUtils {
window.setStartPosition(position);
window.setNumColumns(numColumns);
if (cursor.moveToPosition(position)) {
- do {
+ rowloop: do {
if (!window.allocRow()) {
break;
}
@@ -307,7 +307,7 @@ public class DatabaseUtils {
}
if (!success) {
window.freeLastRow();
- break;
+ break rowloop;
}
}
position += 1;