зеркало из https://github.com/github/putty.git
Use smemclr to wipe defunct bufchain segments.
A minor precaution against leaving secrets visible in process memory: bufchains are used all over the place and probably _something_ in one of them would be better wiped out of RAM.
This commit is contained in:
Родитель
b9f20b84f3
Коммит
e747e9e529
2
utils.c
2
utils.c
|
@ -621,6 +621,7 @@ void bufchain_clear(bufchain *ch)
|
|||
while (ch->head) {
|
||||
b = ch->head;
|
||||
ch->head = ch->head->next;
|
||||
smemclr(b, sizeof(*b));
|
||||
sfree(b);
|
||||
}
|
||||
ch->tail = NULL;
|
||||
|
@ -691,6 +692,7 @@ void bufchain_consume(bufchain *ch, size_t len)
|
|||
ch->head = tmp->next;
|
||||
if (!ch->head)
|
||||
ch->tail = NULL;
|
||||
smemclr(tmp, sizeof(*tmp));
|
||||
sfree(tmp);
|
||||
} else
|
||||
ch->head->bufpos += remlen;
|
||||
|
|
Загрузка…
Ссылка в новой задаче