diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-16 23:52:27 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-17 13:18:16 +0530 |
commit | ba4833355a1ee77f828b538a357e07c46f36b037 (patch) | |
tree | 386a64b8ebe2b71c8e791ff4521de59e300279f4 /libglusterfsclient/src/libglusterfsclient-dentry.c | |
parent | c1b3deff1186c581cb8d9893a3a0de6bf00d3adc (diff) |
libglusterfsclient: Fix segfault on non-NULL loc->name
The gf_log message actually assumes that loc->name will have a valid
non-NULL name in it, whereas if the loc_t being passed to it was
actually created on a function stack, i.e. a local function variable
and was then passed down the code path to do_path_resolve without ever
initing it or zeroing the structure, its possible that the name member
has a non-NULL but corrupted address. This leads to a segfault.
Whereas, we know loc->path will always have the full path.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient-dentry.c')
-rw-r--r-- | libglusterfsclient/src/libglusterfsclient-dentry.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient-dentry.c b/libglusterfsclient/src/libglusterfsclient-dentry.c index c030787cc13..e16e304ba3d 100644 --- a/libglusterfsclient/src/libglusterfsclient-dentry.c +++ b/libglusterfsclient/src/libglusterfsclient-dentry.c @@ -245,9 +245,9 @@ __do_path_resolve (loc_t *loc, libglusterfs_client_ctx_t *ctx, if (parent) { inode_ref (parent); gf_log ("libglusterfsclient-dentry", GF_LOG_DEBUG, - "loc->parent(%"PRId64") already present. sending lookup " - "for %"PRId64"/%s", parent->ino, parent->ino, - loc->name); + "loc->parent(%"PRId64") already present. sending " + "lookup for %"PRId64"/%s", parent->ino, parent->ino, + loc->path); resolved = strdup (loc->path); resolved = dirname (resolved); } else { |