Error out if imported profile file name is too long

Found by ZeroPath

Reported by: Joshua Rogers <joshua@joshua.hu>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/761/merge
Selva Nair 2025-10-25 15:53:53 -04:00 committed by Lev Stipakov
parent 55d6c0883f
commit c6623258c6
1 changed files with 5 additions and 0 deletions

5
as.c
View File

@ -660,6 +660,11 @@ again:
MessageBoxW(hWnd, L"Failed to get TMP path", _T(PACKAGE_NAME), MB_OK);
goto done;
}
if (out_path_size < (wcslen(out_path) + wcslen(name) + 1))
{
MessageBoxW(hWnd, L"Profile name is too long", _T(PACKAGE_NAME), MB_OK | MB_ICONERROR);
goto done;
}
swprintf(out_path, out_path_size, L"%ls%ls", out_path, name);
out_path[out_path_size - 1] = '\0';
FILE *f;