diff options
author | Anthony Newnam <anthony.newnam@garmin.com> | 2010-03-22 17:29:06 -0500 |
---|---|---|
committer | Anthony Newnam <anthony.newnam@garmin.com> | 2010-05-19 07:39:07 -0500 |
commit | f51266471cb6c3e824435ae6e416012a62266d52 (patch) | |
tree | 5a636a2950f503e737468bcd180fee9563d060a9 /core | |
parent | 1152df7e82f1501e72aee1641d028bd7201f6d0b (diff) | |
download | frameworks_base-f51266471cb6c3e824435ae6e416012a62266d52.zip frameworks_base-f51266471cb6c3e824435ae6e416012a62266d52.tar.gz frameworks_base-f51266471cb6c3e824435ae6e416012a62266d52.tar.bz2 |
Don't allow invalid Uris to be added as observers.
If a null segment is added, it will cause problems traversing the list
at a later point.
Change-Id: I5aa97b969cac7231e214168af7d3263b1c16f0a0
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/content/ContentService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/content/ContentService.java b/core/java/android/content/ContentService.java index 974a667..89e504e 100644 --- a/core/java/android/content/ContentService.java +++ b/core/java/android/content/ContentService.java @@ -496,6 +496,9 @@ public final class ContentService extends IContentService.Stub { // Look to see if the proper child already exists String segment = getUriSegment(uri, index); + if (segment == null) { + throw new IllegalArgumentException("Invalid Uri (" + uri + ") used for observer"); + } int N = mChildren.size(); for (int i = 0; i < N; i++) { ObserverNode node = mChildren.get(i); |