projects
/
yaffs2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b5f00f
)
yaffs direct: Modify lseek value checking
author
Charles Manning
<cdhmanning@gmail.com>
Wed, 17 Nov 2010 03:19:51 +0000
(16:19 +1300)
committer
Charles Manning
<cdhmanning@gmail.com>
Wed, 17 Nov 2010 03:20:53 +0000
(16:20 +1300)
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
direct/yaffsfs.c
patch
|
blob
|
history
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index a970577cb4b8b9b2b0be56c1db69e4df441094af..f32808d758829d4893a175f753a7a6fd01ea727f 100644
(file)
--- 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;
}
pos = fSize + offset;
}
- if(pos >= 0)
+ if(pos >= 0
&& pos <= YAFFS_MAX_FILE_SIZE
)
h->position = pos;
h->position = pos;
- else
+ else
{
yaffsfs_SetError(-EINVAL);
yaffsfs_SetError(-EINVAL);
+ pos = -1;
+ }
}
yaffsfs_Unlock();
}
yaffsfs_Unlock();