Commit 8c121ccb by Nathan Sidwell Committed by Nathan Sidwell

* gcov.c (canonicalize_name): Protect use of S_ISLNK.

From-SVN: r181367
parent 2f5623b2
2011-11-14 Nathan Sidwell <nathan@acm.org>
* gcov.c (canonicalize_name): Protect use of S_ISLNK.
2011-11-14 Jan Hubicka <jh@suse.cz> 2011-11-14 Jan Hubicka <jh@suse.cz>
* config/i386/i386.c (core cost model): Correct pasto. * config/i386/i386.c (core cost model): Correct pasto.
...@@ -1688,10 +1688,15 @@ canonicalize_name (const char *name) ...@@ -1688,10 +1688,15 @@ canonicalize_name (const char *name)
{ {
/* '..', we can only elide it and the previous directory, if /* '..', we can only elide it and the previous directory, if
we're not a symlink. */ we're not a symlink. */
struct stat buf; struct stat ATTRIBUTE_UNUSED buf;
*ptr = 0; *ptr = 0;
if (dd_base == ptr || stat (result, &buf) || S_ISLNK (buf.st_mode)) if (dd_base == ptr
#if defined (S_ISLNK)
/* S_ISLNK is not POSIX.1-1996. */
|| stat (result, &buf) || S_ISLNK (buf.st_mode)
#endif
)
{ {
/* Cannot elide, or unreadable or a symlink. */ /* Cannot elide, or unreadable or a symlink. */
dd_base = ptr + 2 + slash; dd_base = ptr + 2 + slash;
......
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