Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
150 stars 71 forks source link

BUG: Fix decompressing all zlib data for NIDS #1394

Closed dopplershift closed 2 weeks ago

dopplershift commented 2 weeks ago

Description of Changes

Code was only expanding the buffer by 10000 bytes as it read through. This resulted in blowing the array bounds when the last, noncompressed chunk of data was larger than this. This was easily broken by products with a single compressed chunk, followed by all uncompressed data. A representative data file and smoke test is included.

This was actually triggered by a failure to build Siphon docs trying to access this data over CDMRemote.

PR Checklist

dopplershift commented 2 weeks ago

FYI, this particular compression should only impact NIDS/Level 3, there should be no impact on the Level 2 decompression.