Closed ghost closed 6 years ago
Hey Phil, thanks for the fix - will look into it.
Thanks.
There are a few more places where something is cleaned but not if an exception is raised before. For example the secure wipe stuff in the AesGcmEncryption class (here).
So most of the issues should be fixed. @JackWhite20 thanks again for pointing them out.
Hey, you are not using the try-catch correctly in the
compress
anddecompress
method. You should close the streams in a finally block, so they are closed even if there is an exception raised. The stream null check is not required for thecompress
method.Example of a correct
decompress
method for theGzipCompressor
class (thegzipInputStream != null
should not happen, but theoreticallynew byte[2048]
can throw anOutOfMemoryException
before thegzipInputStream
instance is created):I would prefer try-with-resources with auto-close, but to support older Java versions and android, this should do it.