From: Charles Manning Date: Wed, 17 Nov 2010 03:19:51 +0000 (+1300) Subject: yaffs direct: Modify lseek value checking X-Git-Tag: linux-mainline-patchset-4~72 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=7b53d290e92e619a315399ba49aadf6b40e13660 yaffs direct: Modify lseek value checking Signed-off-by: Charles Manning --- 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();