Skip to contentSkip to conversation

chunkd: fix debug output when the request key is not null-terminated

PATCH Applied Akinobu Mita 2 participants 2 messages Mar 16, 2010

lore
Share & tools
lore
#0 lore raw

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.

---
 server/server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
server/server.c +2 -1
index 4d9a09e..5b34725 100644
@@ -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
Applied
#1 lore raw
Quoted 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.

---
  server/server.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

applied