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

Commit b17b2987 authored by Steve Kondik's avatar Steve Kondik
Browse files

Avoid running past the end of the tokenizer.

parent f44c5efd
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -514,7 +514,9 @@ public class ProcessStats {
            StringTokenizer st = new StringTokenizer(file, "\n ");
            while (st.hasMoreElements()) {
                String token = st.nextToken();
                if (st.hasMoreElements()) {
                    try {

                        long val = Long.parseLong(token);
                        tempSpeeds[speed] = val;
                        token = st.nextToken();
@@ -531,6 +533,7 @@ public class ProcessStats {
                    }
                }
            }
        }
        if (out == null) {
            out = new long[speed];
            mCpuSpeeds = new long[speed];