Skip to content

Commit 23c6c6e

Browse files
committed
parser_ping: bugfix for handling of 0 payload length messages
1 parent f328e96 commit 23c6c6e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/protocol/parsers/parser_ping.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ class PingParser : public Parser
7777
state++;
7878
break;
7979
case WAIT_SRC_ID:
80+
parseBuf.append(byte);
81+
state++;
82+
break;
8083
case WAIT_DST_ID:
8184
parseBuf.append(byte);
8285
state++;
86+
if (payload_length == 0) { // no payload bytes
87+
state++;
88+
}
8389
break;
8490
case WAIT_PAYLOAD:
8591
parseBuf.append(byte);

0 commit comments

Comments
 (0)