From d35aab1f77b5fc63fa6d9ad9f69f2b9ffe6bb88d Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 5 Apr 2020 09:04:31 -0700 Subject: [PATCH] Clamp read of encrypted uints guards against corrupt values? Closes #55 --- NHSE.WinForms/Editor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NHSE.WinForms/Editor.cs b/NHSE.WinForms/Editor.cs index 56cf484..2bb4093 100644 --- a/NHSE.WinForms/Editor.cs +++ b/NHSE.WinForms/Editor.cs @@ -183,9 +183,9 @@ private void LoadPlayer(int index) var pers = player.Personal; TB_Name.Text = pers.PlayerName; TB_TownName.Text = pers.TownName; - NUD_BankBells.Value = pers.Bank.Value; - NUD_NookMiles.Value = pers.NookMiles.Value; - NUD_Wallet.Value = pers.Wallet.Value; + NUD_BankBells.Value = Math.Min(int.MaxValue, pers.Bank.Value); + NUD_NookMiles.Value = Math.Min(int.MaxValue, pers.NookMiles.Value); + NUD_Wallet.Value = Math.Min(int.MaxValue, pers.Wallet.Value); var photo = pers.GetPhotoData(); var bmp = new Bitmap(new MemoryStream(photo));