X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=f32808d758829d4893a175f753a7a6fd01ea727f;hb=7b53d290e92e619a315399ba49aadf6b40e13660;hp=a970577cb4b8b9b2b0be56c1db69e4df441094af;hpb=3b5f00f58cc6387ada64dd3a19c220ee1403e55e;p=yaffs2.git diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index a970577..f32808d 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -1192,10 +1192,12 @@ off_t yaffs_lseek(int fd, off_t offset, int whence) pos = fSize + offset; } - if(pos >= 0) + if(pos >= 0 && pos <= YAFFS_MAX_FILE_SIZE) h->position = pos; - else + else{ yaffsfs_SetError(-EINVAL); + pos = -1; + } } yaffsfs_Unlock();