chunkd: fix debug output when the request key is not null-terminated
PATCH 1/1 chunkd: fix debug output when the request key is not null-terminated
If the request key is not null-terminated and the debug output is enabled, it prints invalid and unsafe value. Add a precision to fix it.
Signed-off-by Akinobu Mita <[email protected]>
--- server/server.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
server/server.c +2 -1
@@ -1053,9 +1053,10 @@ static bool cli_evt_exec_req(struct client *cli, unsigned int events) goto err_out;if (debugging) - applog(LOG_DEBUG, "REQ(op %s, key %s (%u), user %s) " + applog(LOG_DEBUG, "REQ(op %s, key %.*s (%u), user %s) " "seq %x len %lld login %s", op2str(req->op), + cli->key_len, cli->key, cli->key_len, cli->user,
Signature · 1 line
1.6.5.5
Jeff Garzik
AppliedQuoted 7 lines · Akinobu Mita
If the request key is not null-terminated and the debug output is enabled, it prints invalid and unsafe value. Add a precision to fix it.
Signed-off-by Akinobu Mita<[email protected]>--- server/server.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
applied