Ticket #17679: wxftp.patch

File wxftp.patch, 957 bytes (added by o.kolomiytsev, 3 years ago)

In this patch I have modified minimal sample and have added code that crashes application with wxFTP::Pwd()

  • samples/minimal/minimal.cpp

    diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp
    index f765a70..170d69e 100644
    a b  
    2929    #include "wx/wx.h"
    3030#endif
    3131
     32#include "wx/protocol/ftp.h"
     33
    3234// ----------------------------------------------------------------------------
    3335// resources
    3436// ----------------------------------------------------------------------------
    bool MyApp::OnInit() 
    144146MyFrame::MyFrame(const wxString& title)
    145147       : wxFrame(NULL, wxID_ANY, title)
    146148{
     149    wxFTP ftp;
     150    //! TODO. Enter valid user name
     151    ftp.SetUser(wxT("username"));
     152    //! TODO. Enter valid password
     153    ftp.SetPassword(wxT("password"));
     154
     155    //! TODO. Enter valid ip address
     156    if (ftp.Connect("ip_addres"))
     157    {
     158       wxString str = ftp.Pwd(); //<<------- ERROR: string iterator not dereferencable
     159    }
     160
    147161    // set the frame icon
    148162    SetIcon(wxICON(sample));
    149163