JDK-7144684 : wrong buffer size passed to RegSetValueEx
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2012-02-10
  • Updated: 2013-10-17
  • Resolved: 2012-02-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4Fixed 8 b26Fixed
Description
src/plugin/win32/toolkit/common/JavaFX.cpp

Usage of RegSetValueEx is wrong now - especially now that we are unicode.

  bRet = (RegSetValueEx(key, JFX_DISABLED_KEY, 0, REG_SZ,
             (LPBYTE)disableString, _tcslen(disableString)) == ERROR_SUCCESS);

the last param is the number of bytes that needs to be written out.  it needs to take into account of sizeof(TCHAR).

Comments
Verified using b112
17-10-2013

EVALUATION problem: rc/plugin/win32/toolkit/common/JavaFX.cpp Usage of RegSetValueEx is wrong now - especially now that we are unicode. bRet = (RegSetValueEx(key, JFX_DISABLED_KEY, 0, REG_SZ, (LPBYTE)disableString, _tcslen(disableString)) == ERROR_SUCCESS); the last param is the number of bytes that needs to be written out. it needs to take into account of sizeof(TCHAR). fix: Pass in correct buffer size to RegSetValueEx. Also, added comments to indicate the registry write is actually re-directed. testcase: manual test on DT plugin API enableJavaFX.
10-02-2012