summaryrefslogtreecommitdiff
path: root/sys/kern/kern_lockf.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-08-23 17:09:23 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-08-23 17:09:23 +0000
commit6fb9fbceab43c80a8d8ad50da5dd3b6070b5bd04 (patch)
tree17ea226010307805199b81804fc906f162dff4b8 /sys/kern/kern_lockf.c
parentc18092b2fba2dbc67e4d2cb4ab910c97206f6084 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_lockf.c')
-rw-r--r--sys/kern/kern_lockf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index de8c75daeef6..53c6017739b7 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -122,7 +122,8 @@ lf_advlock(ap, head, size)
case SEEK_END:
/* 'size' is always >= 0 */
- if (fl->l_start > 0 && size > OFF_MAX - fl->l_start)
+ if ((fl->l_start > 0 && size > OFF_MAX - fl->l_start) ||
+ (fl->l_start < 0 && size + fl->l_start > OFF_MAX))
return (EOVERFLOW);
start = size + fl->l_start;
break;