Skip to content

8348872: jabswitch.cpp: regEnable and regDeleteValue leak reallocated data buffer - #32236

Open
MBaesken wants to merge 1 commit into
openjdk:masterfrom
MBaesken:JDK-8348872
Open

8348872: jabswitch.cpp: regEnable and regDeleteValue leak reallocated data buffer#32236
MBaesken wants to merge 1 commit into
openjdk:masterfrom
MBaesken:JDK-8348872

Conversation

@MBaesken

@MBaesken MBaesken commented Aug 6, 2026

Copy link
Copy Markdown
Member


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8348872: jabswitch.cpp: regEnable and regDeleteValue leak reallocated data buffer (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32236/head:pull/32236
$ git checkout pull/32236

Update a local copy of the PR:
$ git checkout pull/32236
$ git pull https://git.openjdk.org/jdk.git pull/32236/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32236

View PR using the GUI difftool:
$ git pr show -t 32236

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32236.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title JDK-8348872: jabswitch.cpp: regEnable and regDeleteValue leak reallocated data buffer 8348872: jabswitch.cpp: regEnable and regDeleteValue leak reallocated data buffer Aug 6, 2026
@openjdk openjdk Bot added the client client-libs-dev@openjdk.org label Aug 6, 2026
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

@MBaesken The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: client. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 6, 2026
@mlbridge

mlbridge Bot commented Aug 6, 2026

Copy link
Copy Markdown

Webrevs

@MBaesken

MBaesken commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

linux-x64-hs-minimal / build - Build / test - seems to have an infrastructure issue 'Failed to resolve action download info. Error: Service Unavailable' - most likely unrelated.

@prrace prrace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK to me but I want @azuev-java to review (and test) it.

if (newStr != NULL) {
wsprintf(newStr, L"%s,%s", dataBuffer, STR_ACCESSBRIDGE);
RegSetValueEx(hKey, ACCESSIBILITY_CONFIG, 0, REG_SZ, (BYTE *)newStr, dataLength);
delete[] newStr;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems unlikely that windows takes ownership of this memory, so we should free it.
However given that jabswitch is very emphemeral as an app, leaks are not a big deal.

@MBaesken

MBaesken commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Lots of 'Failed to resolve action download info. Error: Service Unavailable' in the GHAs, seem to be unrelated .

@MBaesken

MBaesken commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

This looks OK to me but I want @azuev-java to review (and test) it.

Hi Phil, thanks for the review !
I added a number of RegCloseKey calls too, to avoid handle leaks (should not be that bad for a short lived application like jabswitch, but still better to do imho).

Btw. speaking of missing RegCloseKey after RegOpenKeyEx/RegOpenKeyExA, should we add here

LONG lRet = ::RegOpenKeyExA(hRootKey, lpszSubKey, 0, KEY_ALL_ACCESS, &hKey);

too the RegCloseKey calls ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants