I'm seeing crashes for my app that uses SWCompression for Gzip and Deflate decompression. Most probably this is invalid data which isn't actually Gzip compressed, but I'm not exactly sure, as I have never seen this same crash in my own testing of the app.
You can find relevant parts of the stack trace attached below. I'm not too familiar with the code base so did not go ahead with a PR, but maybe there should be a guard check for the last item in the array here, instead of forced unwrap?
Edit: Ah now I notice that the length has 0 items here. Maybe this should be caught earlier before arriving to this method so an error can be thrown for invalid compressed data?
I'm seeing crashes for my app that uses SWCompression for Gzip and Deflate decompression. Most probably this is invalid data which isn't actually Gzip compressed, but I'm not exactly sure, as I have never seen this same crash in my own testing of the app.
You can find relevant parts of the stack trace attached below. I'm not too familiar with the code base so did not go ahead with a PR, but maybe there should be a guard check for the last item in the array here, instead of forced unwrap?
Edit: Ah now I notice that the length has 0 items here. Maybe this should be caught earlier before arriving to this method so an error can be thrown for invalid compressed data?