diff options
author | Jim Meyering <meyering@redhat.com> | 2012-06-20 13:29:38 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-02 15:44:08 -0700 |
commit | 9945a0030a78c33b46dc3fafd313cb87a91289fa (patch) | |
tree | c28ce6f4bffeed821b8d1d3c07e4cd25d1694a9a /libglusterfsclient | |
parent | 237d32b784cfb0ff93f7f1081d89809af962ed56 (diff) |
libgf_count_path_components: don't access pathdup[-1] for empty input
Change-Id: I432f8c8fac907f625d79b2c5bb626a1f7013a73e
BUG: 789278
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3600
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index e09dc39aa3b..3143a13ed4f 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1505,7 +1505,7 @@ libgf_count_path_components (char *path) char *pathdup = NULL; int len = 0; - if (!path) + if (!path || !*path) return -1; pathdup = strdup (path); |