Skip to content

Commit

Permalink
Fix possible loss of data in mosquitto_pub -l when sending multiple…
Browse files Browse the repository at this point in the history
… long lines.

Closes #2078. Thanks to Ysincit.
  • Loading branch information
ralight committed Feb 6, 2021
1 parent 36b4236 commit 24920c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,7 @@
Clients:
- Fix possible loss of data in `mosquitto_pub -l` when sending multiple long
lines. Closes #2078.

2.0.7 - 2021-02-04
==================

Expand Down
2 changes: 1 addition & 1 deletion client/pub_client.c
Expand Up @@ -275,7 +275,7 @@ int pub_stdin_line_loop(struct mosquitto *mosq)
break;
}else{
line_buf_len += 1024;
pos += 1023;
pos += read_len-1;
read_len = 1024;
buf2 = realloc(line_buf, (size_t )line_buf_len);
if(!buf2){
Expand Down

0 comments on commit 24920c9

Please sign in to comment.