mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Handle overflow in FileDescription::seek(, SEEK_CUR)
This commit is contained in:
committed by
Andreas Kling
parent
26bba8e100
commit
2139e0a201
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user