TGEA 1.7.1 recurseDumpPath buf too small
by Michael Gingerich · in Torque Game Engine Advanced · 10/10/2008 (5:25 am) · 1 replies
RecurseDumpPath buf is too small if you have a short path which contains a long filename.
This is the buffer:
TempAlloc< char > buf( lenFullPath + dStrlen( pattern ) + 2 );
This is the line where the buf could be too small:
convertUTF16toUTF8( findData.cFileName, buf, buf.size );
Example path: "C:\temp", pattern "*"
If C:\temp contained a filename with more than 10 characters in length, buf would not be large enough to convert it.
This is the buffer:
TempAlloc< char > buf( lenFullPath + dStrlen( pattern ) + 2 );
This is the line where the buf could be too small:
convertUTF16toUTF8( findData.cFileName, buf, buf.size );
Example path: "C:\temp", pattern "*"
If C:\temp contained a filename with more than 10 characters in length, buf would not be large enough to convert it.
Associate Rene Damm
Replace with:
Should add plenty of headroom under normal circumstances.