mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
This commit is contained in:
parent
3a9f00c59b
commit
97e97bccab
Notes:
sideshowbarker
2024-07-18 04:39:40 +09:00
Author: https://github.com/alimpfard
Commit: 97e97bccab
Pull-request: https://github.com/SerenityOS/serenity/pull/9832
Reviewed-by: https://github.com/IdanHo
105 changed files with 629 additions and 290 deletions
|
@ -35,7 +35,7 @@ CSVExportDialogPage::CSVExportDialogPage(const Sheet& sheet)
|
|||
m_headers.extend(m_data.take_first());
|
||||
|
||||
auto temp_template = String::formatted("{}/spreadsheet-csv-export.{}.XXXXXX", Core::StandardPaths::tempfile_directory(), getpid());
|
||||
auto temp_path = ByteBuffer::create_uninitialized(temp_template.length() + 1);
|
||||
auto temp_path = ByteBuffer::create_uninitialized(temp_template.length() + 1).release_value();
|
||||
auto buf = reinterpret_cast<char*>(temp_path.data());
|
||||
auto copy_ok = temp_template.copy_characters_to_buffer(buf, temp_path.size());
|
||||
VERIFY(copy_ok);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue