1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00
Files
mobile/src/Android/Utilities/IntentExtensions.cs
Federico Maccaroni 04c7409418 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
2021-12-15 15:09:08 -03:00

23 lines
667 B
C#

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);
}
}
}
}