summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-07-17 14:12:24 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-17 14:05:24 -0700
commitf45ea4244288a2397b72c272184c9113ee0c1f08 (patch)
treefb436571defc004d9641f47cccc5daf5d6f5c66d /libglusterfs
parentdbccda35cdcad06208e2fc7554287b539e0060a6 (diff)
break inode_path if the length of the path crosses PATH_MAX
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 134 (infinite loop in inode_path ()) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=134
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/inode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index b0c9abd980c..0ad7b3585b5 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -859,6 +859,13 @@ inode_path (inode_t *inode,
trav = __dentry_search_arbit (trav->parent)) {
i ++; /* "/" */
i += strlen (trav->name);
+ if (i >= PATH_MAX) {
+ gf_log ("inode", GF_LOG_CRITICAL,
+ "possible infinite loop detected, "
+ "forcing break. name=(%s)", name);
+ ret = -ENOENT;
+ goto unlock;
+ }
}
if ((inode->ino != 1) &&