1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

Ensure buffer contents are null-terminated

Data added with `evbuffer_add` isn't null-terminated. This was causing
extra characters to appear at the end of the output.

Fixes: #174
This commit is contained in:
Michael Skree 2018-02-01 21:03:59 -06:00
parent 7669c97e12
commit 663c4532f0

View file

@ -2108,6 +2108,7 @@ static int flush(char const* rpcurl, tr_variant** benc)
break;
default:
evbuffer_add(buf, "", 1);
fprintf(stderr, "Unexpected response: %s\n", evbuffer_pullup(buf, -1));
status |= EXIT_FAILURE;
break;