aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerkeys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r--src/or/routerkeys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index 060ffd8753..ca32228fc7 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -48,7 +48,7 @@ do_getpass(const char *prompt, char *buf, size_t buflen,
size_t p2len = strlen(prompt) + 1;
if (p2len < sizeof(msg))
p2len = sizeof(msg);
- prompt2 = tor_malloc(strlen(prompt)+1);
+ prompt2 = tor_malloc(p2len);
memset(prompt2, ' ', p2len);
memcpy(prompt2 + p2len - sizeof(msg), msg, sizeof(msg));