mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Kernel: Handle overflow in FileDescription::seek(, SEEK_CUR)
This commit is contained in:
parent
26bba8e100
commit
2139e0a201
1 changed files with 2 additions and 0 deletions
|
@ -138,6 +138,8 @@ off_t FileDescription::seek(off_t offset, int whence)
|
|||
new_offset = offset;
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
if (Checked<off_t>::addition_would_overflow(m_current_offset, offset))
|
||||
return -EOVERFLOW;
|
||||
new_offset = m_current_offset + offset;
|
||||
break;
|
||||
case SEEK_END:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue