Skip to content
Permalink
Browse files

in_forward: fix buffer condition that cleans consumed record (#1375)

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
  • Loading branch information...
edsiper committed Jun 10, 2019
1 parent 9703628 commit 20c9cda33c33073ec3d5c0868c1a2ca5e80b5fcb
Showing with 1 addition and 2 deletions.
  1. +1 −2 plugins/in_forward/fw_prot.c
@@ -130,12 +130,11 @@ int fw_prot_process(struct fw_conn *conn)
msgpack_unpacked_destroy(&result);

/* Adjust buffer data */
if (conn->buf_len > all_used && all_used > 0) {
if (conn->buf_len >= all_used && all_used > 0) {
memmove(conn->buf, conn->buf + all_used,
conn->buf_len - all_used);
conn->buf_len -= all_used;
}

return 0;
}

0 comments on commit 20c9cda

Please sign in to comment.
You can’t perform that action at this time.