Changeset 14454

Show
Ignore:
Timestamp:
05/12/08 03:49:02 (3 months ago)
Author:
rouault
Message:

Allocate one extra byte for the NULL terminating character when reading TEXT data in NITF file (#2366)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/nitf/nitfdataset.cpp

    r14450 r14454  
    21712171 
    21722172/* -------------------------------------------------------------------- */ 
    2173 /*      Load the raw CGM data itself.                                   */ 
     2173/*      Load the raw TEXT data itself.                                  */ 
    21742174/* -------------------------------------------------------------------- */ 
    21752175        char *pabyTextData; 
    21762176 
    2177         pabyTextData = (char *) CPLCalloc(1,psSegment->nSegmentSize); 
     2177        /* Allocate one extra byte for the NULL terminating character */ 
     2178        pabyTextData = (char *) CPLCalloc(1,psSegment->nSegmentSize+1); 
    21782179        if( VSIFSeekL( psFile->fp, psSegment->nSegmentStart,  
    21792180                       SEEK_SET ) != 0