Skip to content

Commit

Permalink
Fix a rare NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Dec 19, 2024
1 parent d93a14b commit 31ae6da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion java/org/apache/coyote/http11/Http11InputBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ void recycle() {
activeFilters[i].recycle();
}

byteBuffer.limit(0).position(0);
// Avoid rare NPE reported on users@ list
if (byteBuffer != null) {
byteBuffer.limit(0).position(0);
}
lastActiveFilter = -1;
swallowInput = true;

Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
Don't log warnings for registered HTTP/2 settings that Tomcat does not
support. These settings are now silently ignored. (markt)
</fix>
<fix>
Avoid a rare <code>NullPointerException</code> when recycling the
<code>Http11InputBuffer</code>. (markt)
</fix>
</changelog>
</subsection>
</section>
Expand Down

0 comments on commit 31ae6da

Please sign in to comment.