diff --git a/ChangeLog.txt b/ChangeLog.txt index 5dee52d9ea..8231c01d87 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +Clients: +- Fix possible loss of data in `mosquitto_pub -l` when sending multiple long + lines. Closes #2078. + 1.6.13 - 2021-02-04 =================== diff --git a/client/pub_client.c b/client/pub_client.c index b39c700a2b..59162a2657 100644 --- a/client/pub_client.c +++ b/client/pub_client.c @@ -262,7 +262,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){