зеркало из https://github.com/github/putty.git
Use sgrowarray_nm in GetDlgItemText_alloc
GetDlgItemText_alloc is often used to get passwords from text fields, so the memory should be freed and erased properly. Otherwise parts of passwords might leak in memory. Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
Родитель
7631875d41
Коммит
674219b115
|
@ -163,7 +163,7 @@ char *GetDlgItemText_alloc(HWND hwnd, int id)
|
|||
size_t size = 0;
|
||||
|
||||
do {
|
||||
sgrowarray(ret, size, size);
|
||||
sgrowarray_nm(ret, size, size);
|
||||
GetDlgItemText(hwnd, id, ret, size);
|
||||
} while (!memchr(ret, '\0', size-1));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче