Skip to content

Commit

Permalink
Fix crash when toEcho empty
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd authored and anjohnson committed Nov 1, 2023
1 parent ed7eae5 commit d4bb595
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/pv/responseHandlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ class EchoTransportSender : public TransportSender {
EchoTransportSender(osiSockAddr* echoFrom, size_t payloadSize, epics::pvData::ByteBuffer& payloadBuffer) {
memcpy(&_echoFrom, echoFrom, sizeof(osiSockAddr));
toEcho.resize(payloadSize);
payloadBuffer.getArray(&toEcho[0], payloadSize);
payloadBuffer.getArray(toEcho.data(), payloadSize);
}

virtual ~EchoTransportSender() {}

virtual void send(epics::pvData::ByteBuffer* buffer, TransportSendControl* control) OVERRIDE FINAL {
control->startMessage(CMD_ECHO, toEcho.size(), toEcho.size());
control->setRecipient(_echoFrom);
buffer->putArray<char>(&toEcho[0], toEcho.size());
buffer->putArray<char>(toEcho.data(), toEcho.size());
}

private:
Expand Down

0 comments on commit d4bb595

Please sign in to comment.