Add yet one check for SEEK_END overflow
This commit is contained in:
parent
c18092b2fb
commit
6fb9fbceab
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user