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

Damon Nguyen dnguyen at openjdk.org
Mon Dec 22 21:53:56 UTC 2025


On Mon, 22 Dec 2025 21:38:24 GMT, Phil Race <prr at openjdk.org> wrote:

>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update printf
>
> src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 231:
> 
>> 229:                 fprintf(origFile,
>> 230:                     "assistive_technologies=com.sun.java.accessibility.AccessBridge\n"
>> 231:                     "screen_magnifier_present=true\n");
> 
> I don't think it is what Alexander meant.
> I am not sure doing the above  would even resolve the complaint because there's still no format string.
> 
> I think he meant it should look like
> fprintf(origfile, "%s",
> "assistive_technologies=com.sun.java.accessibility.AccessBridge\n"screen_magnifier_present=true\n");
> or
> fprintf(origfile, "%s",
> "assistive_technologies=com.sun.java.accessibility.AccessBridge\n" "screen_magnifier_present=true\n");
> if you really want to use the automatic concatenation, but I had to check to be sure it would work so ..

I see your point. I'll leave it as separated again just in case the string literal is updated with anything that can be misinterpreted as a specifier.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28949#discussion_r2641344380


More information about the client-libs-dev mailing list