available_out is the "remaining size of output buffer", and total_out is "number of bytes decompressed so far"
available_out is what is passed to DeliverBodyClear and then to SubmitData. I believe this is what is causing extracted files to contain many megabytes of trailing null bytes.
I believe that a buffer is used incorrectly in
https://github.com/MITRECND/bro-http2/blob/54b9d68453e4601ecc19bf60f18d21bd4688d186/src/HTTP2_Stream.cc#L230-L248
According to the docs: https://github.com/google/brotli/blob/9cd01c0437e8b6010434d3491a348a5645de624b/c/include/brotli/decode.h#L231-L235
available_out
is the "remaining size of output buffer", andtotal_out
is "number of bytes decompressed so far"available_out
is what is passed toDeliverBodyClear
and then toSubmitData
. I believe this is what is causing extracted files to contain many megabytes of trailing null bytes.