Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60919953 authored by Mark Wagner's avatar Mark Wagner
Browse files

check offset and don't crash

parent 7c02ef11
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -1564,6 +1564,10 @@ public class TextUtils {
     * {@link #CAP_MODE_SENTENCES}.
     * {@link #CAP_MODE_SENTENCES}.
     */
     */
    public static int getCapsMode(CharSequence cs, int off, int reqModes) {
    public static int getCapsMode(CharSequence cs, int off, int reqModes) {
        if (off < 0) {
            return 0;
        }

        int i;
        int i;
        char c;
        char c;
        int mode = 0;
        int mode = 0;