mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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…
Reference in a new issue