mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
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:
parent
7631875d41
commit
674219b115
@ -163,7 +163,7 @@ char *GetDlgItemText_alloc(HWND hwnd, int id)
|
|||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
sgrowarray(ret, size, size);
|
sgrowarray_nm(ret, size, size);
|
||||||
GetDlgItemText(hwnd, id, ret, size);
|
GetDlgItemText(hwnd, id, ret, size);
|
||||||
} while (!memchr(ret, '\0', size-1));
|
} while (!memchr(ret, '\0', size-1));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user