<AWT Dev> RFR: 8211826: StringIndexOutOfBoundsException happens via GetStringUTFRegion()

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu May 9 00:41:51 UTC 2019


Hi, Ichiroh.
This version looks fine, thank you contribution.

On 07/05/2019 10:23, Ichiroh Takiguchi wrote:
> Hello Sergey.
> 
> Sorry for bad response.
> 
> Could you review the fix again ?
> 
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8211826
> Change: https://cr.openjdk.java.net/~itakiguchi/8211826/webrev.03/
> 
> I applied following changes
> * Modified testcaes for awt_UNIXToolkit.c (become simpler)
> * Clean up the buffer on swing_GTKEngine.c by memset()
> 
> I wrote the testcase for swing_GTKEngine.c.
> (It's in JDK-8211826)
> It's not easy to detect buffer overflow...
> 
> Ichiroh Takiguchi
> 
> On 2019-04-03 06:55, Sergey Bylokhov wrote:
>> Hi, Ichiroh.
>>
>> On 28/03/2019 06:27, Ichiroh Takiguchi wrote:
>>> * On swing_GTKEngine.c, maximum length size for String data is arranged.
>>>      -static char conversionBuffer[CONV_BUFFER_SIZE];
>>>      +static char conversionBuffer[(CONV_BUFFER_SIZE - 1) * 3 + 1];
>>
>> As far as I understand that this will allocate the array for the worst
>> case, should we cleanup it before each usage? Otherwise we can mix
>> different strings.
> 


-- 
Best regards, Sergey.


More information about the awt-dev mailing list