Skip to content

Commit

Permalink
Fix nasa#298, fix inifinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
avan989 committed Oct 9, 2019
1 parent 2214306 commit b7e1307
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fsw/cfe-core/src/fs/cfe_fs_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,14 @@ int16 FS_gz_fill_inbuf_Reentrant( CFE_FS_Decompress_State_t *State )
{
len = OS_read( State->srcFile_fd, (int8*)State->inbuf + State->insize, INBUFSIZ - State->insize );

if ( len == 0 || len == EOF || len == OS_FS_ERROR ) break;
if ( len <= 0 ) break;

State->insize += len;

} while ( State->insize < INBUFSIZ );


if ( State->insize == 0 ) return EOF;

if ( len == OS_FS_ERROR )
if ( State->insize == 0 || len < 0)
{
State->Error = CFE_FS_GZIP_READ_ERROR;
return EOF;
Expand Down

0 comments on commit b7e1307

Please sign in to comment.