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

Commit 9bb3dacb authored by John Spurlock's avatar John Spurlock
Browse files

Fix NPE in StrictMode handling.

Bug:17875462
Change-Id: I0bf31abe2d07335addd57976aca110565bb63cc4
parent 4c880877
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1726,6 +1726,7 @@ public final class StrictMode {
            if (LOG_V) Log.d(TAG, "strict mode violation stacks read from binder call.  i=" + i);
            ViolationInfo info = new ViolationInfo(p, !currentlyGathering);
            if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
                String front = info.crashInfo.stackTrace.substring(256);
                // 10000 characters is way too large for this to be any sane kind of
                // strict mode collection of stacks.  We've had a problem where we leave
                // strict mode violations associated with the thread, and it keeps tacking
@@ -1742,7 +1743,7 @@ public final class StrictMode {
                // Now report the problem.
                Slog.wtfStack(TAG, "Stack is too large: numViolations=" + numViolations
                        + " policy=#" + Integer.toHexString(policyMask)
                        + " front=" + info.crashInfo.stackTrace.substring(256));
                        + " front=" + front);
                return;
            }
            info.crashInfo.stackTrace += "# via Binder call with stack:\n" + ourStack;