Copy my newly introduced l_len<0 'oops' fix from kern_lockf.c

This commit is contained in:
Andrey A. Chernov 2001-08-23 16:06:14 +00:00
parent 62be011ebd
commit ea4313e351

View file

@ -1008,10 +1008,12 @@ smbfs_advlock(ap)
if (start < 0)
return EINVAL;
if (fl->l_len < 0) {
start += fl->l_len;
if (start <= 0)
if (start == 0)
return EINVAL;
end = start - 1;
start += fl->l_len;
if (start < 0)
return EINVAL;
} else if (fl->l_len == 0)
end = -1;
else {