Commit a088c30d authored by Dan Lipsa's avatar Dan Lipsa

Add check for long lines and increase available space.

parent a8f86e37
......@@ -170,7 +170,7 @@ int vtkOBJReader::RequestData(
{ // (make a local scope section to emphasise that the variables below are only used here)
const int MAX_LINE = 1024;
const int MAX_LINE = 1024 * 256;
char rawLine[MAX_LINE];
char tcoordsName[100];
float xyz[3];
......@@ -188,6 +188,12 @@ int vtkOBJReader::RequestData(
char *pLine = rawLine;
char *pEnd = rawLine + strlen(rawLine);
if (*(pEnd-1) != '\n' && ! feof(in))
{
vtkErrorMacro(<< "Line longer than " << MAX_LINE << ": " << pLine);
everything_ok = false;
}
// find the first non-whitespace character
while (isspace(*pLine) && pLine < pEnd) { pLine++; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment