From c6623258c63d2d64885ea76d3c680254f9fe6bbc Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Sat, 25 Oct 2025 15:53:53 -0400 Subject: [PATCH] Error out if imported profile file name is too long Found by ZeroPath Reported by: Joshua Rogers Signed-off-by: Selva Nair --- as.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/as.c b/as.c index d0e99dd..445b1a7 100644 --- a/as.c +++ b/as.c @@ -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;