Skip to content

Commit

Permalink
event_stream: Add '> 0' check in case buf.len is negative
Browse files Browse the repository at this point in the history
CID #417478
  • Loading branch information
oanatitoc committed Sep 25, 2024
1 parent c05364f commit 2c97cde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/event_stream/stream_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void handle_reply_jsonrpc(struct stream_con *con)
buf.len -= bytes_read;
buf.s += bytes_read;

if (buf.len) {
if (buf.len > 0) {
/* XXX: this was not tested! */
/* still have stuff to parse - move it in the connection */
if (con->pending_buffer.s) {
Expand Down

0 comments on commit 2c97cde

Please sign in to comment.