mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8334670: SSLSocketOutputRecord buffer miscalculation
Reviewed-by: djelinski, ssahoo
This commit is contained in:
parent
4ebb77120a
commit
07bc523df8
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -168,12 +168,12 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord {
|
||||||
|
|
||||||
for (int limit = (offset + length); offset < limit;) {
|
for (int limit = (offset + length); offset < limit;) {
|
||||||
|
|
||||||
int remains = (limit - offset) + (count - position);
|
int remains = (limit - offset);
|
||||||
int fragLen = Math.min(fragLimit, remains);
|
int fragLen = Math.min(fragLimit - count + position, remains);
|
||||||
|
|
||||||
// use the buf of ByteArrayOutputStream
|
// use the buf of ByteArrayOutputStream
|
||||||
write(source, offset, fragLen);
|
write(source, offset, fragLen);
|
||||||
if (remains < fragLimit) {
|
if (remains < fragLen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue