kee-org / KeeFox

Legacy browser and XUL application integration with KeePass Password Safe. See https://github.com/kee-org/browser-addon for the new version for Firefox 57+
https://forum.kee.pm
418 stars 48 forks source link

System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string #544

Closed pdvorchik closed 9 years ago

pdvorchik commented 9 years ago

Hi luckyrat, Thanks so much for your work on this plugin -- it's a HUGE time saver. I owe you a beer sometime.
Small bug report for you, though it's somewhat pebcak.

To reproduce:

Error:

************** Exception Text **************
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at KeePassRPC.URLSummary.FromURL(String URL)
   at KeePassRPC.KeePassRPCExt.UpgradeURLPortEntriesToRetainSubdomainExclusivity(PwDatabase db)
   at KeePassRPC.KeePassRPCExt.OnKPDBOpen(Object sender, FileOpenedEventArgs e)
   at KeePass.Forms.MainForm.OpenDatabase(IOConnectionInfo ioConnection, CompositeKey cmpKey, Boolean bOpenLocal)
   at KeePass.Forms.MainForm.OnFileLock(Object sender, EventArgs e)
   at KeePass.Forms.MainForm.OnFormResize(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnResize(EventArgs e)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at KeePass.Forms.MainForm.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
luckyrat commented 9 years ago

Thanks for the report. We should be able to handle that kind of problematic entry without crashing so I'll take a look soon.