summaryrefslogtreecommitdiff
path: root/AK/Base64.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-09-06 03:29:52 +0430
committerAndreas Kling <kling@serenityos.org>2021-09-06 01:53:26 +0200
commit97e97bccab085823d1365cb54142fd8c41dbcd8c (patch)
tree9008687dbcdfb6f36f6dc6372aa382b15b9d36c8 /AK/Base64.cpp
parent3a9f00c59bad7735970c72cb940d08161fda09b0 (diff)
downloadserenity-97e97bccab085823d1365cb54142fd8c41dbcd8c.zip
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
Diffstat (limited to 'AK/Base64.cpp')
-rw-r--r--AK/Base64.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/Base64.cpp b/AK/Base64.cpp
index 04e67e6b54..661d9c53ee 100644
--- a/AK/Base64.cpp
+++ b/AK/Base64.cpp
@@ -87,7 +87,8 @@ ByteBuffer decode_base64(const StringView& input)
output.append(out2);
}
- return ByteBuffer::copy(output.data(), output.size());
+ // FIXME: Handle OOM failure.
+ return ByteBuffer::copy(output).release_value();
}
String encode_base64(ReadonlyBytes input)