grib icon indicating copy to clipboard operation
grib copied to clipboard

Crash while reading file

Open landru29 opened this issue 7 years ago • 4 comments

http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_1p00.pl?bottomlat=-90&dir=%2Fgfs.2019020512&file=gfs.t12z.pgrb2.1p00.f003&leftlon=0&lev_10_m_above_ground=on&rightlon=360&toplat=90&var_UGRD=on&var_VGRD=on

panic: runtime error: makeslice: len out of range

goroutine 1 [running]: github.com/nilsmagnus/grib/griblib.ReadMessage(0x177be20, 0xc420336060, 0x0, 0x17e6fc8, 0x0) github.com/nilsmagnus/grib/griblib/sections.go:80 +0xb4 github.com/nilsmagnus/grib/griblib.ReadMessages(0x177be20, 0xc420336060, 0xc42004f520, 0x55ec6e, 0x7fa8dea7a160, 0xc420382060, 0xc42004f520) github.com/nilsmagnus/grib/griblib/sections.go:58 +0x9b

landru29 avatar Feb 08 '19 13:02 landru29

Oups! Noaa switched to https ! the data I recieved is not grib file. But the read should not panic, just through an error

landru29 avatar Feb 08 '19 13:02 landru29

Hmm, how can I reproduce this situation?

nilsmagnus avatar Feb 09 '19 18:02 nilsmagnus

head -n 8 gfs.t06z.pgrb2.0p50.f000 > 1.txt |cat -

--593d9cc39dbbd1cf Content-type: text/plain; charset=UTF-8 Content-range: bytes 66461079-66628632/90829745

GRIB��� H�P�i����]J�0�]J�m��� � "Q�1�PE��

like this?

Oups! Noaa switched to https ! the data I recieved is not grib file. But the read should not panic, just through an error

wwek avatar Oct 01 '19 14:10 wwek

We ran into this issue. I've created a pull request with a fix that appears to be working well for us.

measuredweighed avatar Feb 11 '20 10:02 measuredweighed