Changeset 14455 for branches

Show
Ignore:
Timestamp:
05/12/08 03:49:15 (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
  • branches/1.5/gdal/frmts/nitf/nitfdataset.cpp

    r14420 r14455  
    21032103 
    21042104/* -------------------------------------------------------------------- */ 
    2105 /*      Load the raw CGM data itself.                                   */ 
     2105/*      Load the raw TEXT data itself.                                  */ 
    21062106/* -------------------------------------------------------------------- */ 
    21072107        char *pabyTextData; 
    21082108 
    2109         pabyTextData = (char *) CPLCalloc(1,psSegment->nSegmentSize); 
     2109        /* Allocate one extra byte for the NULL terminating character */ 
     2110        pabyTextData = (char *) CPLCalloc(1,psSegment->nSegmentSize+1); 
    21102111        if( VSIFSeekL( psFile->fp, psSegment->nSegmentStart,  
    21112112                       SEEK_SET ) != 0