summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fseek.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-09-01 15:01:37 +0000
committerache <ache@FreeBSD.org>2001-09-01 15:01:37 +0000
commit77759ea63b149af08d749c57155482f866c1b82c (patch)
treec01a3dc9af80865d862e13f614a5e434eea97690 /lib/libc/stdio/fseek.c
parent20c6fc0914ac6458f420965d5f0770cc7488cb80 (diff)
downloadFreeBSD-src-77759ea63b149af08d749c57155482f866c1b82c.zip
FreeBSD-src-77759ea63b149af08d749c57155482f866c1b82c.tar.gz
Remove even more unneded checks, original code can't overflows in that place
Diffstat (limited to 'lib/libc/stdio/fseek.c')
-rw-r--r--lib/libc/stdio/fseek.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c
index 0e1d461..e831347 100644
--- a/lib/libc/stdio/fseek.c
+++ b/lib/libc/stdio/fseek.c
@@ -232,8 +232,6 @@ _fseeko(fp, offset, whence, ltest)
* file offset for the first byte in the current input buffer.
*/
if (HASUB(fp)) {
- if (curoff > 0 && fp->_r > OFF_MAX - curoff)
- goto abspos;
curoff += fp->_r; /* kill off ungetc */
n = fp->_extra->_up - fp->_bf._base;
curoff -= n;
@@ -249,9 +247,7 @@ _fseeko(fp, offset, whence, ltest)
* simply adjust the pointers, clear EOF, undo ungetc(),
* and return.
*/
- if (target >= curoff &&
- (curoff <= 0 || n <= OFF_MAX - curoff) &&
- target < curoff + n) {
+ if (target >= curoff && target < curoff + n) {
size_t o = target - curoff;
fp->_p = fp->_bf._base + o;
OpenPOWER on IntegriCloud