1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-12 06:13:21 +00:00

Fix Unsafe deserialization of Parcel data Intent (#1691)

* Fix crash produced by unsafe deserialization of Parcel data passed on the intent

* Fix crash produced by unsafe deserialization of Parcel data passed on the intent on other activities and renamed intent extension method
This commit is contained in:
Federico Maccaroni
2021-12-15 15:09:08 -03:00
committed by GitHub
parent 705b8ac12b
commit 04c7409418
5 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
using Android.Content;
using Android.OS;
namespace Bit.Droid.Utilities
{
public static class IntentExtensions
{
public static void Validate(this Intent intent)
{
try
{
// Check if getting the bundle of the extras causes any exception when unparcelling
// Note: getting the bundle like this will cause to call unparcel() internally
var b = intent?.Extras?.GetBundle("trashstringwhichhasnousebuttocheckunparcel");
}
catch (BadParcelableException)
{
intent.ReplaceExtras((Bundle)null);
}
}
}
}