diff options
Diffstat (limited to 'mbbsd/record.c')
-rw-r--r-- | mbbsd/record.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/record.c b/mbbsd/record.c index 83bafe76..7e6206e8 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -300,7 +300,9 @@ safe_article_delete_range(const char *direct, int from, int to) lseek(fd, sizeof(fileheader_t) * (from - 1), SEEK_SET) != -1 ){ for( ; from <= to ; ++from ){ - read(fd, &newfhdr, sizeof(fileheader_t)); + // the (from, to) range may be invalid... + if (read(fd, &newfhdr, sizeof(fileheader_t)) != sizeof(fileheader_t)) + break; if( newfhdr.filemode & (FILE_MARKED | FILE_DIGEST) ) continue; if(newfhdr.filename[0]=='L') newfhdr.filename[0]='M'; |