This commit is contained in:
Nav
2024-11-28 21:49:03 +00:00
parent 9c1b194af1
commit 8e86cfb152
12 changed files with 67 additions and 54 deletions

View File

@@ -11,6 +11,7 @@
#include "Exceptions/ClientCommunicationError.hpp"
#include "src/Exceptions/Exception.hpp"
#include "src/Exceptions/InternalFatalErrorException.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Services/StringService.hpp"
@@ -207,6 +208,10 @@ namespace DebugServer::Gdb
bool interruptible,
std::optional<std::chrono::milliseconds> timeout
) {
if (bytes.has_value() && *bytes > Connection::ABSOLUTE_MAXIMUM_PACKET_READ_SIZE) {
throw InternalFatalErrorException{"Attempted to read too many bytes from GDB socket"};
}
auto output = std::vector<unsigned char>{};
if (this->readInterruptEnabled != interruptible) {