Changes between Initial Version and Version 1 of Ticket #5258


Ignore:
Timestamp:
Oct 7, 2013, 4:59:45 AM (11 years ago)
Author:
Even Rouault
Comment:

Can you submit your proposed corrections as a patch ? It would also be good if you could provide a way (data + command line) to reproduce the issue.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5258 – Description

    initial v1  
    11In 'hfaopen.cpp': Following lines use 'poPro->proName', 'poPro->proSpheroid.sphereName' and 'poPro->proExeName' and if any of them happen to be null, this cause an access violation and a crash.
    22
     3
     4{{{
    351450            nSize = 34 + 15 * 8
    461451                + 8 + strlen(poPro->proName) + 1
     
    21231456
    2224
     25}}}
     26
    2327A simple fix would be to initialize the length to 0 and update it the string in question is not not null with the real length.
    2428
     
    2731We are setting the string and if it happens to be null, SetFieldValue would cause a crash:
    2832
     33
     34{{{
    2935901     CPLErr HFAEntry::SetStringField( const char * pszFieldPath,
    3036902                                      const char * pszValue )
     
    3339905         return SetFieldValue( pszFieldPath, 's', (void *) pszValue );
    3440906     }
     41}}}
    3542
    3643Thanks