kee-org / keepassrpc

The KeePassRPC plugin that needs to be installed inside KeePass in order for Kee to be able to connect your browser to your passwords
GNU General Public License v2.0
635 stars 35 forks source link

Delete key attempts to delete form fields when it should not #91

Closed xantiva closed 1 year ago

xantiva commented 4 years ago

I posted this first in in the KeePass issue tracker, but I got the info, that it is an error of the KeePassRPC plugin ...

Keepass 2.43

I use KeePass together with Kee in Firefox. If I want to edit the entries (Edit Entry:Kee:FormFields) I can reproduce an ArgumentOutOfRangeException ...

Steps to reproduce: Open Edit Entry:Kee:FormFields (with some entries in it) Select an item somewhere in the middle. Delete the item with the Del-Key (Entf. in German) The item will be deleted. Press the same key again. The Exception occures.

Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.ArgumentOutOfRangeException: InvalidArgument=Value mit dem Wert 0 ist für index ungültig.
Parametername: index
   bei System.Windows.Forms.ListView.SelectedListViewItemCollection.get_Item(Int32 index)
   bei KeePassRPC.Forms.KeeEntryUserControl.buttonFieldDelete_Click(Object sender, EventArgs e)
   bei KeePassRPC.Forms.KeeEntryUserControl.listView2_KeyUp(Object sender, KeyEventArgs e)
   bei System.Windows.Forms.Control.OnKeyUp(KeyEventArgs e)
   bei System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   bei System.Windows.Forms.Control.WmKeyChar(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ListView.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4075.0 built by: NET48REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll.
----------------------------------------
KeePass
    Assembly-Version: 2.43.0.18739.
    Win32-Version: 2.43.0.0.
    CodeBase: file:///C:/Program%20Files%20(x86)/KeePass%20Password%20Safe%202/KeePass.exe.
----------------------------------------
System
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4001.0 built by: NET48REL1LAST_C.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4042.0 built by: NET48REL1LAST_C.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Configuration
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
System.Core
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.4075.0 built by: NET48REL1LAST.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.
----------------------------------------
System.Xml
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
KeePassHttp
    Assembly-Version: 2.34.0.0.
    Win32-Version: 1.8.4.2.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/Hev6ytOGZVF4kWrks8B4/KeePassHttp.dll.
----------------------------------------
KeePassRPC
    Assembly-Version: 2.0.34.21879.
    Win32-Version: 1.8.0.0.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/h4HKkgJ65VxVU1M5HZ73/KeePassRPC.dll.
----------------------------------------
Fleck2
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/h4HKkgJ65VxVU1M5HZ73/Fleck2.DLL.
----------------------------------------
DomainPublicSuffix
    Assembly-Version: 2.0.1.0.
    Win32-Version: 2.0.1.0.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/h4HKkgJ65VxVU1M5HZ73/DomainPublicSuffix.DLL.
----------------------------------------
Jayrock
    Assembly-Version: 0.9.12915.0.
    Win32-Version: 0.9.11214.1056.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/h4HKkgJ65VxVU1M5HZ73/Jayrock.DLL.
----------------------------------------
System.Security
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll.
----------------------------------------
KeePass.XmlSerializers
    Assembly-Version: 2.43.0.18739.
    Win32-Version: 2.43.0.18739.
    CodeBase: file:///C:/Program%20Files%20(x86)/KeePass%20Password%20Safe%202/KeePass.XmlSerializers.DLL.
----------------------------------------
Jayrock.Json
    Assembly-Version: 0.9.12915.0.
    Win32-Version: 0.9.13422.2206.
    CodeBase: file:///C:/Users/Mike/AppData/Local/KeePass/PluginCache/h4HKkgJ65VxVU1M5HZ73/Jayrock.Json.DLL.
----------------------------------------
System.Numerics
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll.
----------------------------------------
Microsoft.GeneratedCode
    Assembly-Version: 1.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
System.Data
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.8.3752.0 built by: NET48REL1.
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.
luckyrat commented 4 years ago

Interesting. I didn't know that you could press the delete key in that list. I wonder if that's always been the case!

The solution should be fairly straightforward - following similar logic to whether the Delete button is enabled or disabled, only attempting the delete in situations where that button would currently be enabled.