X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/217f9d07673020ad2f995f269552dad27950a6e4..b7b35e5063b8430324ba2fa05d5e6f58a34dd3b9:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 5ac040b271..b25e322760 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -460,6 +460,8 @@ size_t wxCmdLineParser::GetParamCount() const wxString wxCmdLineParser::GetParam(size_t n) const { + wxCHECK_MSG( n < GetParamCount(), wxEmptyString, _T("invalid param index") ); + return m_data->m_parameters[n]; } @@ -988,7 +990,7 @@ static wxString GetTypeName(wxCmdLineParamType type) /* This function is mainly used under Windows (as under Unix we always get the - command line arguments as agrc/argv anyhow) and so it tries to handle the + command line arguments as argc/argv anyhow) and so it tries to handle the Windows path names (separated by backslashes) correctly. For this it only considers that a backslash may be used to escape another backslash (but normally this is _not_ needed) or a quote but nothing else.