JDK-8226810: An other case and a small change suggestion
Brent Christian
brent.christian at oracle.com
Mon May 11 23:40:30 UTC 2020
FYI, I've filed a new issue[1] for this fix, and requested a code review:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-May/066384.html
I don't believe I need anything else, Johannes. Thank you!
-Brent
1. https://bugs.openjdk.java.net/browse/JDK-8244767
On 5/10/20 7:47 AM, Johannes Kuhn wrote:
> On 09-May-20 1:27, Brent Christian wrote:
>> On 5/7/20 5:50 AM, Alan Bateman wrote:
>>> On 07/05/2020 12:37, Johannes Kuhn wrote:
>>>> :
>>>>
>>>> In the end, I don't know what causes the bug, or how I can replicate
>>>> it.
>>>> I think I did find a likely suspect.
>> >
>>> Good sleuthing. I don't what the conditions are for GetLocaleInfo to
>>> fail but it does look like that would return possibly non-terminated
>>> garbage starting with "CP" so we should at least fix that.
>>
>> I agree. I can file a bug and sponsor this small change.
>>
>> -Brent
> Thank you.
>
> After the discussion with Naoto, I would like to change the one line to
> strcpy(ret + 2, "1252")
>
> diff --git a/src/java.base/windows/native/libjava/java_props_md.c
> b/src/java.base/windows/native/libjava/java_props_md.c
> --- a/src/java.base/windows/native/libjava/java_props_md.c
> +++ b/src/java.base/windows/native/libjava/java_props_md.c
> @@ -73,6 +73,7 @@
> LOCALE_IDEFAULTANSICODEPAGE,
> ret+2, 14) == 0) {
> codepage = 1252;
> + strcpy(ret + 2, "1252");
> } else {
> codepage = atoi(ret+2);
> }
>
> I have already signed the OCA.
> This would be my first patch. Is there anything else you need?
>
> I will take a further look into GetLocaleInfo, and try to find a model
> that works for me (currently thinking about blackbox, can return
> anything from [1]),
> and then discussing how to handle all those cases.
>
> - Johannes
>
> [1]:
> https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
More information about the core-libs-dev
mailing list