Skip to content
Discussion options

You must be logged in to vote

Here:

https://github.com/MassiPi/DaikinS21/blob/d6f7e9d6db6ef019a3612d11fc4c4639ae5893d6/src/main.cpp#L241-L243

  AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len); //  creates a buffer (len + 1) for you.
  if (buffer) {
    serializeJson(root, (char *)buffer->get(), len + 1);

You are overflowing the array.

should be:

  AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len);
  if (buffer) {
    serializeJson(root, buffer->get(), len);

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@MassiPi
Comment options

@mathieucarbou
Comment options

@MassiPi
Comment options

@mathieucarbou
Comment options

Answer selected by MassiPi
@MassiPi
Comment options

@mathieucarbou
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants