1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

AK+Everywhere: Make Base64 decoding fallible

This commit is contained in:
Ben Wiederhake 2021-10-23 15:43:59 +02:00 committed by Linus Groh
parent 3bf1f7ae87
commit cb868cfa41
11 changed files with 73 additions and 32 deletions

View file

@ -113,7 +113,11 @@ int main(int argc, char** argv)
}
auto base64_data = line.substring(8);
auto buffer = decode_base64(base64_data);
socket->send(buffer, false);
if (buffer.has_value()) {
socket->send(buffer.value(), false);
} else {
outln("Could not send message : Base64 string contains an invalid character.");
}
continue;
}
if (line == ".exit") {