diff options
author | Raph Levien <raph@google.com> | 2014-11-14 20:54:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-14 20:54:29 +0000 |
commit | 505ffe3633f45778e493e23ad8c163f09ed1dbb5 (patch) | |
tree | 0dda3eb9cf8d365b48c500e0c5fcd40b51154073 /graphics/java | |
parent | 25f7c4b99284cd1e118f50bd585e6534acfad7c4 (diff) | |
parent | d82f8a9a3869448e6d7d4b3fc962e34e33a1ba0e (diff) | |
download | frameworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.zip frameworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.tar.gz frameworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.tar.bz2 |
Merge "Check bounds on CharSequence drawText methods" into lmp-mr1-dev
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index 8279a51..499608e 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -1710,6 +1710,9 @@ public class Canvas { */ public void drawText(@NonNull CharSequence text, int start, int end, float x, float y, @NonNull Paint paint) { + if ((start | end | (end - start) | (text.length() - end)) < 0) { + throw new IndexOutOfBoundsException(); + } if (text instanceof String || text instanceof SpannedString || text instanceof SpannableString) { native_drawText(mNativeCanvasWrapper, text.toString(), start, end, x, y, |