dev  

DO NOT REPLY [Bug 49851] New: JNI Registry.deleteKey and Registry.deleteValue corrupt Windows registry

bugzilla
Tue, 31 Aug 2010 10:18:58 -0700

https://issues.apache.org/bugzilla/show_bug.cgi?id=49851

           Summary: JNI Registry.deleteKey and Registry.deleteValue
                    corrupt Windows registry
           Product: Tomcat Native
           Version: 1.1.20
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Library
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: vadim.ts...@snapon.com


The issue was discovered in version 1.1.20 of Tomcat Native libraries while
trying to use Registry class on Windows XP.
Unlike other methods, deleteKey() and deleteValue() do not initialize
parameters that are passed to Windows APIs.
Typical initialization of string parameters consists of 

TCN_ALLOC_WSTRING(name);
...
TCN_INIT_WSTRING(name);
...
TCN_FREE_WSTRING(name);

However, the two methods listed above do not call TCN_INIT_WSTRING. Without
this, the Windows API SHDeleteKeyW() is called with a null (0) parameter that
causes Windows registry corruption. In my case (before issue was diagnosed) it
resulted in the need to re-install Windows (twice) :-(.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

  • DO NOT REPLY [Bug 49851] New: JNI Registry.deleteKey and Registry.deleteValue corrupt Windows registry bugzilla