From b261177b8f5bc3f8495406d13dc03c0328b930f9 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 2 May 2016 14:45:22 +0200 Subject: Windows/Linux/MacOSX: Set maximum PIM value to 2147468 in order to avoid having negative values for iterations count using the formula 15000 + (PIM x 1000). Add specific error message to XML language files. --- src/Mount/Mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Mount/Mount.c') diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 1851af06..7dabc5ff 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -2506,6 +2506,13 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return 1; } + if (!bSysEncPwdChangeDlgMode && (pim > MAX_PIM_VALUE)) + { + SetFocus (GetDlgItem(hwndDlg, IDC_PIM)); + Error ("PIM_TOO_BIG", hwndDlg); + return 1; + } + if (pwdChangeDlgMode == PCDM_CHANGE_PKCS5_PRF) { newKeyFilesParam.EnableKeyFiles = KeyFilesEnable; @@ -8712,7 +8719,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) { wchar_t* endPtr = NULL; CmdVolumePim = (int) wcstol(szTmp, &endPtr, 0); - if (CmdVolumePim < 0 || endPtr == szTmp || *endPtr != L'\0') + if (CmdVolumePim < 0 || CmdVolumePim > MAX_PIM_VALUE || endPtr == szTmp || *endPtr != L'\0') { CmdVolumePim = 0; AbortProcess ("COMMAND_LINE_ERROR"); -- cgit v1.2.3