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(-)

diff --git a/server/server.c b/server/server.c
index 4d9a09e..5b34725 100644
--- a/server/server.c
+++ b/server/server.c
@@ -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,
-- 
1.6.5.5

--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to