From 69218b92a51a0852736fc3b1253605fe2c020053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 8 Jul 2022 23:12:31 +0200 Subject: 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. --- Userland/Utilities/disk_benchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Utilities/disk_benchmark.cpp') diff --git a/Userland/Utilities/disk_benchmark.cpp b/Userland/Utilities/disk_benchmark.cpp index eac041f9f3..e21888dee8 100644 --- a/Userland/Utilities/disk_benchmark.cpp +++ b/Userland/Utilities/disk_benchmark.cpp @@ -105,7 +105,7 @@ ErrorOr 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); -- cgit v1.2.3