X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6d4038a8bf3ae178bc89cceaf60a0652749ea9b..4219d8b027a351fb6c2d1580c292e639bd322f77:/src/msw/dialup.cpp diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index cce425e056..afab3e9a9d 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -163,7 +163,7 @@ struct WXDLLEXPORT wxRasThreadData HANDLE hEventRas, // automatic event which RAS signals when status changes hEventQuit; // manual event which we signal when we terminate - class WXDLLEXPORT wxDialUpManagerMSW *dialUpManager; // the owner + class WXDLLIMPEXP_FWD_CORE wxDialUpManagerMSW *dialUpManager; // the owner }; // ---------------------------------------------------------------------------- @@ -709,7 +709,13 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const if ( dwRet == ERROR_BUFFER_TOO_SMALL ) { // reallocate the buffer - rasEntries = (RASENTRYNAME *)realloc(rasEntries, size); + void *n = realloc(rasEntries, size); + if (n == NULL) + { + free(rasEntries); + return 0; + } + rasEntries = (RASENTRYNAME *)n; } else if ( dwRet != 0 ) { @@ -801,7 +807,7 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, RASDIALPARAMS rasDialParams; rasDialParams.dwSize = sizeof(rasDialParams); - wxStrncpy(rasDialParams.szEntryName, entryName, RAS_MaxEntryName); + wxStrlcpy(rasDialParams.szEntryName, entryName.c_str(), RAS_MaxEntryName); // do we have the username and password? if ( !username || !password ) @@ -823,8 +829,8 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, } else { - wxStrncpy(rasDialParams.szUserName, username, UNLEN); - wxStrncpy(rasDialParams.szPassword, password, PWLEN); + wxStrlcpy(rasDialParams.szUserName, username.c_str(), UNLEN); + wxStrlcpy(rasDialParams.szPassword, password.c_str(), PWLEN); } // default values for other fields