From: <ai...@us...> - 2010-12-17 03:08:21
|
Revision: 11375 http://plplot.svn.sourceforge.net/plplot/?rev=11375&view=rev Author: airwin Date: 2010-12-17 02:22:50 +0000 (Fri, 17 Dec 2010) Log Message: ----------- Change internal truncation limit for filename length returned by plgfnam from 79 characters to 255 characters. We probably will have to solve this issue with a plgfnam API change instead (see discussion on list), since this alternative means that those who stick to the old limit of 80 will _always_ get a buffer overflow. However, this does appear to work with the examples that have recently been changed to use a 256-character buffer for the filename. Modified Paths: -------------- trunk/src/plcore.c Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2010-12-17 01:51:49 UTC (rev 11374) +++ trunk/src/plcore.c 2010-12-17 02:22:50 UTC (rev 11375) @@ -3632,15 +3632,15 @@ { if ( fnam == NULL ) { - plabort( "filename string must be preallocated to >=80 bytes" ); + plabort( "filename string must be preallocated to >=256 bytes" ); return; } *fnam = '\0'; if ( plsc->FileName != NULL ) { - strncpy( fnam, plsc->FileName, 79 ); - fnam[79] = '\0'; + strncpy( fnam, plsc->FileName, 255 ); + fnam[255] = '\0'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |