diff options
author | ache <ache@FreeBSD.org> | 2001-08-29 18:53:53 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-08-29 18:53:53 +0000 |
commit | e4aa34eee032faef51918fdfa9d9f0758d999654 (patch) | |
tree | b13679ad244312a2106286a1bc88442dada379a3 /sys/kern/kern_descrip.c | |
parent | 2718e600893a07376eef7b04996fdeab3aeff0da (diff) | |
download | FreeBSD-src-e4aa34eee032faef51918fdfa9d9f0758d999654.zip FreeBSD-src-e4aa34eee032faef51918fdfa9d9f0758d999654.tar.gz |
advlock: simplify overflow checks
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index f1f6284..d040690 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -307,10 +307,9 @@ fcntl(p, uap) return (error); } if (fl.l_whence == SEEK_CUR) { - if ((fl.l_start > 0 && - fp->f_offset > OFF_MAX - fl.l_start) || - (fl.l_start < 0 && - fp->f_offset < OFF_MIN - fl.l_start)) { + if (fp->f_offset < 0 || + (fl.l_start > 0 && + fp->f_offset > OFF_MAX - fl.l_start)) { fdrop(fp, p); return (EOVERFLOW); } |