diff options
| author | Jeff Brown <jeffbrown@google.com> | 2015-05-29 18:48:38 -0700 |
|---|---|---|
| committer | Joe LaPenna <jlapenna@google.com> | 2015-06-02 00:00:34 +0000 |
| commit | eb4bd19ef09b2c277347b08c4a050f01f686c9c2 (patch) | |
| tree | 05b4283455d535d17baeb987ddc5c23ffe992aa9 /core/java/android | |
| parent | 06756f352d2046246bc147fa1f55d1dfbfcb37f5 (diff) | |
Terminate loop properly when cursor window is full. DO NOT MERGE
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
(cherry picked from commit bb8c841e909a2fb967db2ad3b9f8b058f9b849e8)
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/database/DatabaseUtils.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/database/DatabaseUtils.java b/core/java/android/database/DatabaseUtils.java index c1255440986c..c23e7b2869e6 100644 --- a/core/java/android/database/DatabaseUtils.java +++ b/core/java/android/database/DatabaseUtils.java @@ -272,7 +272,7 @@ public class DatabaseUtils { window.setStartPosition(position); window.setNumColumns(numColumns); if (cursor.moveToPosition(position)) { - do { + rowloop: do { if (!window.allocRow()) { break; } @@ -309,7 +309,7 @@ public class DatabaseUtils { } if (!success) { window.freeLastRow(); - break; + break rowloop; } } position += 1; |
