Show
Ignore:
Timestamp:
07/01/08 17:30:06 (5 months ago)
Author:
peter
Message:

source/punch_fits.cpp:

Bug-fix: fix another potential array overrun while copying the chVersion string.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/punch_fits.cpp

    r2036 r2144  
    737737 
    738738        strcpy( tempString, "Generated by Cloudy " ); 
    739         strcat( tempString, version::Inst().chVersion ); 
     739        // strncat guarantees that terminating 0 byte will always be written... 
     740        strncat( tempString, version::Inst().chVersion, sizeof(tempString)-strlen(tempString) ); 
    740741        bytesAdded += addComment( tempString ); 
    741742        bytesAdded += addComment( version::Inst().chInfo );