GRIB-292: fix bug with checking num bytes when EOF reached

This commit is contained in:
Shahram Najm 2013-07-04 15:27:50 +01:00
parent f859cd51cc
commit 372f119dcb
1 changed files with 5 additions and 5 deletions

View File

@ -757,7 +757,7 @@
ibytes=nbytes ibytes=nbytes
iret=grib_f_read_any_from_file(ifile,buffer,ibytes) iret=grib_f_read_any_from_file(ifile,buffer,ibytes)
if (ibytes > huge(nbytes)) then if (iret == GRIB_SUCCESS .and. ibytes > huge(nbytes)) then
iret = GRIB_MESSAGE_TOO_LARGE iret = GRIB_MESSAGE_TOO_LARGE
endif endif
nbytes=ibytes nbytes=ibytes
@ -817,7 +817,7 @@
ibytes=nbytes ibytes=nbytes
iret=grib_f_read_any_from_file(ifile,buffer,ibytes) iret=grib_f_read_any_from_file(ifile,buffer,ibytes)
if (ibytes > huge(nbytes)) then if (iret == GRIB_SUCCESS .and. ibytes > huge(nbytes)) then
iret = GRIB_MESSAGE_TOO_LARGE iret = GRIB_MESSAGE_TOO_LARGE
endif endif
nbytes=ibytes nbytes=ibytes
@ -877,7 +877,7 @@
ibytes=nbytes ibytes=nbytes
iret=grib_f_read_any_from_file(ifile,buffer,ibytes) iret=grib_f_read_any_from_file(ifile,buffer,ibytes)
if (ibytes > huge(nbytes)) then if (iret == GRIB_SUCCESS .and. ibytes > huge(nbytes)) then
iret = GRIB_MESSAGE_TOO_LARGE iret = GRIB_MESSAGE_TOO_LARGE
endif endif
nbytes=ibytes nbytes=ibytes
@ -937,7 +937,7 @@
ibytes=nbytes ibytes=nbytes
iret=grib_f_read_any_from_file(ifile,buffer,ibytes) iret=grib_f_read_any_from_file(ifile,buffer,ibytes)
if (ibytes > huge(nbytes)) then if (iret == GRIB_SUCCESS .and. ibytes > huge(nbytes)) then
iret = GRIB_MESSAGE_TOO_LARGE iret = GRIB_MESSAGE_TOO_LARGE
endif endif
nbytes=ibytes nbytes=ibytes
@ -2699,7 +2699,7 @@
integer(kind=kindOfSize_t) :: ibytes integer(kind=kindOfSize_t) :: ibytes
iret = grib_f_get_message_size ( gribid, ibytes ) iret = grib_f_get_message_size ( gribid, ibytes )
if (ibytes > huge(nbytes)) then if (iret == GRIB_SUCCESS .and. ibytes > huge(nbytes)) then
iret = GRIB_MESSAGE_TOO_LARGE iret = GRIB_MESSAGE_TOO_LARGE
endif endif
nbytes = ibytes nbytes = ibytes