On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter <b...@openjdk.org> wrote:

>> Limit native memory allocation and move write loop from the native layer 
>> into Java. This change should make the OOME reported in the issue much less 
>> likely.
>
> Brian Burkhalter has updated the pull request incrementally with three 
> additional commits since the last revision:
> 
>  - 6478546: Decrease malloc limit to 1.5 MB
>  - 6478546: Minor refactoring
>  - 6478546: Prevent short read

The EOF handling in the above should be

                    if (n < 0) {
                        // EOF
                        if (nread == 0)
                            return -1;
                        break;
                    }

or zero will be returned if EOF is encountered on the first read (I made the 
same mistake in code that was not checked in).

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

PR Comment: https://git.openjdk.org/jdk/pull/14981#issuecomment-1652242356

Reply via email to