nilsmagnus / grib

Golang GRIB2 parser
Other
57 stars 19 forks source link

Throw error when parsing invalid section0 indicator #18

Closed measuredweighed closed 4 years ago

measuredweighed commented 4 years ago

This pull request fixes the issue mentioned in #17 whereby invalid/arbitrary data would cause a panic. This change basically requires that section0's GRIB indicator be valid before allowing parsing to continue, throwing an error instead of panic-ing.

I've attached an example file from a NOAA.gov source that returned an HTML error page instead of the expected grib file, which caused the panic for us.

nilsmagnus commented 4 years ago

Thanks for the PR @measuredweighed! I will tag a new version right away.

nilsmagnus commented 4 years ago

v1.2.4 is out now

measuredweighed commented 4 years ago

👍 Thank you for such a quick response (and for all of your hard work on the wonderful library).

nilsmagnus commented 4 years ago

I had to update a test as well, so the correct version is now v1.2.5. Glad you liked the library :smile:

What are you using it for if I can ask? If you dont want to answer publicly my email is nilsmagnus @ gmail.com