Danek Duvall wrote:
<snip>
In os_unix.c, the path we trace through mch_FullName() grabs the cwd into "buf"
(an input parameter) with mch_dirname(), which succeeds, since it's just short
enough to fit into the 1024-byte buffer (with the trailing NUL). We then get
the strlen() of buf, returning 1023, as the truss output shows on line 72731.
We then compare that value to the input parameter "len", which is the size of
"buf", and since 1023 is not>= 1024, we assume we can add a slash to the end,
overwriting the end of the buffer.
<snip>
Shouldn't the buffer size (1024 mentioned above) be set, at least under
unix, to a value at least as large as indicated by pathconf()?
For example, under Scientific Linux 6.0:
pathconf(".",_PC_PATH_MAX) yields 4096
(_PC_PATH_MAX returns the maximum length of a relative pathname when
path or fd is the current working directory)
Regards,
Chip Campbell
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php