rbd: fix off-by-one error in key name

Fixes: #2846
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2012-07-31 11:55:56 -07:00 committed by Sage Weil
parent e775ce52ab
commit f22b95da27

View File

@ -694,7 +694,7 @@ static int do_kernel_add(const char *poolname, const char *imgname,
oss << " name=" << user;
char key_name[strlen(user) + strlen("client.")];
char key_name[strlen(user) + strlen("client.")+1];
snprintf(key_name, sizeof(key_name), "client.%s", user);
char secret_buf[MAX_SECRET_LEN];
char *secret = NULL;