linmaogithub / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

CFDE_TxtEdtDoRecord_DeleteRange::Serialize / Deserialize are scary looking. #189

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There's some pointer casting that's sure to fail on 64 bit platforms, as well 
as the possibility of wild pointer derefernces depending upon how the 
serialized result is persisted.

To wit:

    ArchiveSaver << (int32_t)(uintptr_t)m_pEngine;

then:

    int32_t nEngine = 0;
    ArchiveLoader >> nEngine;
    m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;

Original issue reported on code.google.com by tsepez@chromium.org on 27 Jul 2015 at 5:11