summaryrefslogtreecommitdiff
path: root/Userland/Utilities/disk_benchmark.cpp
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2022-07-08 23:12:31 +0200
committerSam Atkins <atkinssj@gmail.com>2022-07-09 09:25:20 +0100
commit69218b92a51a0852736fc3b1253605fe2c020053 (patch)
tree3b1240e2fd169b48b756201317876737e3cbb947 /Userland/Utilities/disk_benchmark.cpp
parent7dd3c5c981fccb0fa3b19f1b4ba9f6f7e046b306 (diff)
downloadserenity-69218b92a51a0852736fc3b1253605fe2c020053.zip
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.
Diffstat (limited to 'Userland/Utilities/disk_benchmark.cpp')
-rw-r--r--Userland/Utilities/disk_benchmark.cpp2
1 files changed, 1 insertions, 1 deletions
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<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);