Skip to content

Commit a9520e6

Browse files
committed
Fix #343 (Incorrect output buffer boundary check in CsvEncoder)
1 parent cebda38 commit a9520e6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

csv/src/main/java/com/fasterxml/jackson/dataformat/csv/impl/CsvEncoder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public final void write(int columnIndex, int value) throws IOException
390390
if (columnIndex == _nextColumnToWrite) {
391391
// inlined 'appendValue(int)'
392392
// up to 10 digits and possible minus sign, leading comma
393-
if ((_outputTail + 12) > _outputTail) {
393+
if ((_outputTail + 12) > _outputEnd) {
394394
_flushBuffer();
395395
}
396396
if (_nextColumnToWrite > 0) {
@@ -409,7 +409,7 @@ public final void write(int columnIndex, long value) throws IOException
409409
if (columnIndex == _nextColumnToWrite) {
410410
// inlined 'appendValue(int)'
411411
// up to 20 digits, minus sign, leading comma
412-
if ((_outputTail + 22) > _outputTail) {
412+
if ((_outputTail + 22) > _outputEnd) {
413413
_flushBuffer();
414414
}
415415
if (_nextColumnToWrite > 0) {

release-notes/VERSION-2.x

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Active Maintainers:
1919
#335: (yaml) Update to SnakeYAML 1.32
2020
(contributed by @pjfanning)
2121

22+
2.13.5 (not yet released)
23+
24+
#343: Incorrect output buffer boundary check in `CsvEncoder`
25+
(reported by k163377@github)
26+
2227
2.13.4 (03-Sep-2022)
2328

2429
#329: (yaml) Update to SnakeYAML 1.31

0 commit comments

Comments
 (0)