RFR: 8373474: 2 Unintentional format string defect groups in jabswitch.cpp [v4]

Alexey Ivanov aivanov at openjdk.org
Tue Dec 23 17:23:10 UTC 2025


On Mon, 22 Dec 2025 23:36:30 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> This issue is not currently causing any problems, but I am adding specifiers to explicitly print these strings. This is to avoid any issues down the line where changes to the lines building the string can cause any accidental formatting. Overall, this should be a harmless update and improves the stability and reliability of printing these strings.
>
> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments

Changes requested by aivanov (Reviewer).

src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 1:

> 1: /*

You should update the copyright year.

src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 321:

> 319:         "jabswitch enables or disables the Java Access Bridge.\n",
> 320:         versionString
> 321:     );

If `versionString` isn't used for anything else, we can remove the `versionString` variable and the call to `sprintf_s` and put the arguments to print the version string directly into the `printf` call.

-------------

PR Review: https://git.openjdk.org/jdk/pull/28949#pullrequestreview-3608777582
PR Review Comment: https://git.openjdk.org/jdk/pull/28949#discussion_r2643836065
PR Review Comment: https://git.openjdk.org/jdk/pull/28949#discussion_r2643832334


More information about the client-libs-dev mailing list