Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-19567

[REGEDIT] Unhandled exception when attempting to create a new key at the root

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.15
    • Applications
    • None

    Description

      reactos-bootcd-0.4.15-dev-8021-g7ce96fd-x86-gcc-lin-dbg

      • Open Regedit
      • Select "My Computer"
      • Right click on the "Name" column header, New, Key
      • Crash due to Unhandled exception

      Unhandled exception
      ExceptionCode:    c0000005
      Faulting Address: 00000000
      CS:EIP 1b:4157aa
      DS 23 ES 23 FS 3b GS 0
      EAX: 00000000   EBX: 00008011   ECX: 00000007
      EDX: 00000001   EBP: 0022ed68   ESI: 00008011   ESP: 0022eb20
      EDI: 0002016e   EFLAGS: 00010246 Address:
      * <regedit.exe:157aa (base/applications/regedit/treeview.c:597 (CreateNewKey))> (C:\ReactOS\regedit.exe@400000)
      Frames:
      * <regedit.exe:bb00 (base/applications/regedit/framewnd.c:1286 (_CmdWndProc))> (C:\ReactOS\regedit.exe@400000)
      * <regedit.exe:c303 (base/applications/regedit/framewnd.c:1399 (FrameWndProc))> (C:\ReactOS\regedit.exe@400000)
      * <user32.dll:6b51e (win32ss/user/user32/windows/wndproc_fixup.S:48 (CALL_EXTERN_WNDPROC))> (C:\ReactOS\system32\user32.dll@77a20000)
      * <user32.dll:5f814 (win32ss/user/user32/windows/message.c:1547 (IntCallWindowProcW))> (C:\ReactOS\system32\user32.dll@77a20000)
      * <user32.dll:5fc2e (win32ss/user/user32/windows/message.c:1798 (IntCallMessageProc))> (C:\ReactOS\system32\user32.dll@77a20000)
      * <user32.dll:6039f (win32ss/user/user32/windows/message.c:2046 (DispatchMessageW))> (C:\ReactOS\system32\user32.dll@77a20000)
      * <regedit.exe:10c1b (base/applications/regedit/main.c:244 (wWinMain))> (C:\ReactOS\regedit.exe@400000)
      * <regedit.exe:19621 (sdk/lib/crt/startup/crt0_w.c:24 (wmain))> (C:\ReactOS\regedit.exe@400000)
      * <regedit.exe:18ca7 (sdk/lib/crt/startup/crtexe.c:306 (__tmainCRTStartup))> (C:\ReactOS\regedit.exe@400000)
      * <regedit.exe:18cfc (sdk/lib/crt/startup/crtexe.c:162 (wWinMainCRTStartup))> (C:\ReactOS\regedit.exe@400000)
      * <kernel32.dll:11cde (dll/win32/kernel32/client/proc.c:463 (BaseProcessStartup))> (C:\ReactOS\system32\kernel32.dll@7c600000) err:(win32ss/user/user32/windows/messagebox.c:1048) MessageBox: L"The instruction at \"0x004157aa\" referenced memory at \"0x00000000\". The memory could not be \"read\".\r\n\nCliquez sur OK pour terminer le programme.\nCliquez sur Annuler pour d\00e9boguer le programme."
       

      Bug is due to 

      pszKeyPath = GetItemPath(hwndTV, hItem, &hRootKey);
      if (pszKeyPath[0] == L'\0') 

      because GetItemPath returns NULL in this case and is not checked for this error code prior attempting to access to pszKeyPath[0]

      PATCH : regedit.patch

      Attachments

        1. image-2024-05-04-10-23-28-848.png
          24 kB
          KRosUser
        2. regedit.patch
          0.5 kB
          KRosUser

        Activity

          People

            MayTheChicken MayTheChicken
            KRosUser KRosUser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: