Skip to content

Commit

Permalink
Can't pass nullptr to memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed May 22, 2024
1 parent 84941b9 commit 01058d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct WebSocket : AsyncSocket<SSL> {
/* Special path for long sends of non-compressed, non-SSL messages */
if (message.length() >= 16 * 1024 && !compress && !SSL && !webSocketData->subscriber && getBufferedAmount() == 0 && Super::getLoopData()->corkOffset == 0) {
char header[10];
int header_length = (int) protocol::formatMessage<isServer>(header, nullptr, 0, opCode, message.length(), compress, fin);
int header_length = (int) protocol::formatMessage<isServer>(header, "", 0, opCode, message.length(), compress, fin);
int written = us_socket_write2(0, (struct us_socket_t *)this, header, header_length, message.data(), (int) message.length());

if (written != header_length + (int) message.length()) {
Expand Down

0 comments on commit 01058d9

Please sign in to comment.