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:
Sven Strickroth 2019-03-19 08:39:08 +01:00 коммит произвёл Simon Tatham
Родитель 7631875d41
Коммит 674219b115
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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));