The problem only appears when running dot with -Tdot, -Tplain & -Tplain-ext. Output of jpg, gif, png, imap etc all appear to work OK.
Had a look at the source code. In dotneato/common/output.c function dotneato_write(). The only thing in common in the above output modes is a call to attach_attrs() in the same file.
Inspection of the function attach_attrs() reveals the following code pattern:
{
char buf[BUFSIZ],*p;
p = buf;
for (...) /* there two of these */
{
sprintf(p,"%d,%d", ...);
while (*p) p++;
}
agset(e,"pos",buf);
}
It is evident from the above code that there is no protection from a buffer overrun in variable buf.
On Windows platforms BUFSIZ is set in STDIO.H to 512. On Linux platforms BUFSIZ is set to 8192. In other words, BUFSIZ is compiler and operating system dependent.
When run on Linux, the max line length of the output file, after removing line splits, appears to be at least 2020. I have no easy access to a debug version, so to check can you run dot with the supplied file, and check how many bytes of variable buf are used. If it is more than 512 then the problem is confirmed.
If confirmed and fixed, I would appreciate a new Windows build of dot.
Input:
Input file: b106.dot
Sorry about the large source file, the problem only happens with large ones.
Comments:
Overlooked static buffer in attach_attrs in output.c;
see also b104, b102, b103.
Owner: erg
Status: Fixed (8 March 2002)