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:
parent
3bf1f7ae87
commit
cb868cfa41
11 changed files with 73 additions and 32 deletions
|
@ -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") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue