Commit 1440435
authored
Fix bug in forEachByte on nested composite bytebuf with leak detection (#12790)
Motivation:
An NPE could occur when forEachByte was called on nested leak-aware composite byte buffers.
Modification:
WrappedCompositeByteBuf extends CompositeByteBuf but must delegate all calls to the wrapped instance.
Add delegation calls for forEachByteAsc0 and forEachByteDesc0.
Without delegation, those calls would, from an outer composite buffer, go to the composite structure of the wrapper buffer, which have no components.
Result:
No more NPE when calling forEachByte on nested composite leak-aware buffers.
Fixes #127871 parent ef4a9df commit 1440435
2 files changed
Lines changed: 43 additions & 0 deletions
File tree
- buffer/src
- main/java/io/netty/buffer
- test/java/io/netty/buffer
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
411 | 421 | | |
412 | 422 | | |
413 | 423 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1774 | 1775 | | |
1775 | 1776 | | |
1776 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1777 | 1810 | | |
0 commit comments