1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

LibCore+Userland: Use StringViews when calling Core::System::open

For some reason we used raw char pointers sometimes, which caused at
least one heap buffer overflow detected in fuzzing.
This commit is contained in:
kleines Filmröllchen 2022-07-08 23:12:31 +02:00 committed by Sam Atkins
parent 7dd3c5c981
commit 69218b92a5
3 changed files with 3 additions and 3 deletions

View file

@ -105,7 +105,7 @@ ErrorOr<Result> benchmark(String const& filename, int file_size, ByteBuffer& buf
if (!allow_cache)
flags |= O_DIRECT;
int fd = TRY(Core::System::open(filename.characters(), flags, 0644));
int fd = TRY(Core::System::open(filename, flags, 0644));
auto fd_cleanup = ScopeGuard([fd, filename] {
auto void_or_error = Core::System::close(fd);