Skip to content

Bug 2011536 - sanitize intent before interacting with it.#50

Closed
pollym wants to merge 1 commit intomozilla-firefox:autolandfrom
pollym:classnotfound-intent-crash
Closed

Bug 2011536 - sanitize intent before interacting with it.#50
pollym wants to merge 1 commit intomozilla-firefox:autolandfrom
pollym:classnotfound-intent-crash

Conversation

@pollym
Copy link
Contributor

@pollym pollym commented Jan 30, 2026

We are seeing ClassCastExceptions in the crash report - this is likely to be happening because some external intent has serialized some class that our app doesn't know about. Calling this sanitize() function strips out unknown classes from the bundle. Intent.putExtra() will internally call unparcel(), which assumes the bundle is serializable, so we need to call sanitize before doing this.

Running a try here

We are seeing `ClassCastException`s in the crash report - this is likely to be happening because some external intent has serialized some class that our app doesn't know about.
Calling this `sanitize()` function strips out unknown classes from the bundle.
`Intent.putExtra()` will internally call unparcel(), which assumes the bundle is serializable, so we need to call sanitize before doing this.
@github-actions
Copy link
Contributor

View this pull request in Lando to land it once approved.

Copy link
Contributor

@jonalmeida jonalmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty straight-forward fix to me, thanks!

nit: if the change is a speculative fix, can we add that to the commit message so that we know we can re-open the bug if it doesn't fix the all the crashes linked to it.

@jonalmeida
Copy link
Contributor

testing-exception-other: we ought to test this by monitoring our Nightly audience. Automated testing would not be able to uncover much.

lando-prod-mozilla bot pushed a commit that referenced this pull request Feb 2, 2026
We are seeing `ClassCastException`s in the crash report - this is likely to be happening because some external intent has serialized some class that our app doesn't know about. Calling this `sanitize()` function strips out unknown classes from the bundle. `Intent.putExtra()` will internally call unparcel(), which assumes the bundle is serializable, so we need to call sanitize before doing this.

[Running a try here](https://treeherder.mozilla.org/jobs?repo=try&revision=9a328763a8bcbf33ecc7e9116aceaa5854f85157)

Pull request: #50
@lando-prod-mozilla
Copy link

Pull request closed by commit a2e0bf0

akliuxingyuan pushed a commit to akliuxingyuan/firefox-android that referenced this pull request Mar 24, 2026
We are seeing `ClassCastException`s in the crash report - this is likely to be happening because some external intent has serialized some class that our app doesn't know about. Calling this `sanitize()` function strips out unknown classes from the bundle. `Intent.putExtra()` will internally call unparcel(), which assumes the bundle is serializable, so we need to call sanitize before doing this.

[Running a try here](https://treeherder.mozilla.org/jobs?repo=try&revision=9a328763a8bcbf33ecc7e9116aceaa5854f85157)

Pull request: mozilla-firefox/firefox#50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants