mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
TmpFS: Add ASSERT(offset >= 0) to read_bytes() and write_bytes()
This commit is contained in:
parent
c48acafcba
commit
a49d9c774f
1 changed files with 2 additions and 0 deletions
|
@ -155,6 +155,7 @@ ssize_t TmpFSInode::read_bytes(off_t offset, ssize_t size, u8* buffer, FileDescr
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
ASSERT(!is_directory());
|
ASSERT(!is_directory());
|
||||||
ASSERT(size >= 0);
|
ASSERT(size >= 0);
|
||||||
|
ASSERT(offset >= 0);
|
||||||
|
|
||||||
if (!m_content.has_value())
|
if (!m_content.has_value())
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -170,6 +171,7 @@ ssize_t TmpFSInode::write_bytes(off_t offset, ssize_t size, const u8* buffer, Fi
|
||||||
{
|
{
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
ASSERT(!is_directory());
|
ASSERT(!is_directory());
|
||||||
|
ASSERT(offset >= 0);
|
||||||
|
|
||||||
off_t old_size = m_metadata.size;
|
off_t old_size = m_metadata.size;
|
||||||
off_t new_size = m_metadata.size;
|
off_t new_size = m_metadata.size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue