Commit graph

6 commits

Author SHA1 Message Date
Ali Mohammad Pur 7d4a30af56 LibCore: Avoid logical OOB read in AllocatingMemoryStream::offset_of()
The previous impl was trimming the last chunk to the free space instead
of the used space, which yielded an OOB read if the needle wasn't found.
2023-01-20 20:34:31 +00:00
Tim Schumacher daf181caa8 LibCore: Let offset-related Stream functions return an unsigned value
A negative return value doesn't make sense for any of those functions.
The return types were inherited from POSIX, where they also need to have
an indicator for an error (negative values).
2023-01-19 11:41:56 +01:00
Tim Schumacher 1ca62de558 LibCore: Return EBADF on unsupported stream operations 2023-01-19 11:41:56 +01:00
Tim Schumacher 156b6e83cd LibCore: Add AllocatingMemoryStream::offset_of 2023-01-14 00:33:35 +03:30
Tim Schumacher f205f62a44 LibCore: Add an automatically allocating MemoryStream
Similar to AK::DuplexStream, this writes to the end and reads from the
beginning of a dynamically allocated buffer.
2022-12-15 13:28:29 +00:00
Tim Schumacher 8dbc7aa63f LibCore: Move the MemoryStream implementation into a separate file 2022-12-15 13:28:29 +00:00