github-advanced-security[bot] commented on code in PR #1173:
URL: https://github.com/apache/tomcat/pull/1173#discussion_r4577265261
##########
java/org/apache/coyote/http2/StreamProcessor.java:
##########
@@ -234,7 +236,11 @@
if (noSendfile && protocol != null &&
protocol.useCompression(coyoteRequest, coyoteResponse)) {
// Enable compression. Headers will have been set. Need to
configure
// output filter at this point.
- stream.addOutputFilter(new GzipOutputFilter());
+ if (CompressionConfig.isBrotli(coyoteResponse)) {
+ stream.addOutputFilter(new BrotliOutputFilter());
Review Comment:
## CodeQL / Dereferenced variable may be null
Variable [stream](1) may be null at this access as suggested by [this](2)
null guard.
Variable [stream](1) may be null at this access because of [this](3) null
argument.
[Show more
details](https://github.com/apache/tomcat/security/code-scanning/1291)
##########
java/org/apache/coyote/http2/StreamProcessor.java:
##########
@@ -234,7 +236,11 @@
if (noSendfile && protocol != null &&
protocol.useCompression(coyoteRequest, coyoteResponse)) {
// Enable compression. Headers will have been set. Need to
configure
// output filter at this point.
- stream.addOutputFilter(new GzipOutputFilter());
+ if (CompressionConfig.isBrotli(coyoteResponse)) {
+ stream.addOutputFilter(new BrotliOutputFilter());
+ } else {
+ stream.addOutputFilter(new GzipOutputFilter());
Review Comment:
## CodeQL / Dereferenced variable may be null
Variable [stream](1) may be null at this access as suggested by [this](2)
null guard.
Variable [stream](1) may be null at this access because of [this](3) null
argument.
[Show more
details](https://github.com/apache/tomcat/security/code-scanning/1292)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]