Menu

#135 Checked Iterators

closed-rejected
nobody
wxpdfdoc (23)
5
2011-07-11
2011-07-11
Anonymous
No

If wxWidgets and wxPDFdoc are compiled with _SECURE_SCL=0 at runtime there is an exception at

wxPdfEncoding::wxPdfEncoding()
{
m_encoding = wxEmptyString;
m_baseEncoding = wxEmptyString;
m_specific = false;
m_firstChar = 0;
m_lastChar = 0;
m_cmap.Alloc(256); <<---------- EXCEPTION
m_cmapBase.Alloc(256);
m_glyphNames.Alloc(256);
m_cmap.Insert(0, 0, 256);
m_cmapBase.Insert(0, 0, 256);
m_glyphNames.Insert(wxString(wxT(".notdef")), 0, 256);
m_encodingMap = NULL;
}

Discussion

  • Ulrich Telle

    Ulrich Telle - 2011-07-11

    IMHO this problem is not related to wxPdfDocument in particular. The statement you flagged as throwing an exception is a call to method Alloc of a wxWidgets class (wxBaseArrayLong). There is nothing wxPdfDocument can do about it.

    The symbol _SECURE_SCL is related to STL containers. This indicates that you compiled wxWidgets with wxUSE_STL enabled. That's not the wxWidgets default and enabling it is not necessary to use STL classes in your own code.

    I found the following link (http://connect.microsoft.com/VisualStudio/feedback/details/524141/serious-bug-when-using-secure-scl-0-c). The Microsoft answer therein makes very clear that you have to be very careful when using _SECURE_SCL. I suspect a mismatch, so you should double check your different modules to match the rules stated in the article mentioned above. Good luck.

     
  • Ulrich Telle

    Ulrich Telle - 2011-07-11
    • status: open --> closed-rejected
     

Log in to post a comment.