Commit 33286587 authored by Nick Mathewson's avatar Nick Mathewson
Browse files

Merge remote-tracking branch 'asn/bug19223'

parents 4f169a02 e59f0d4c
o Minor bugfixes (getpass):
- Defensively fix a non-triggerable heap corruption at do_getpass() tow
protect ourselves from mistakes in the future. Fixes bug #19223; bugfix
on Bug found by Guido Vranken, patch by nherring.
\ No newline at end of file
......@@ -48,8 +48,8 @@ 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);
memset(prompt2, ' ', p2len);
prompt2 = tor_malloc(p2len);
memset(prompt2, ' ', p2len - sizeof(msg));
memcpy(prompt2 + p2len - sizeof(msg), msg, sizeof(msg));
buf2 = tor_malloc_zero(buflen);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment