From 9945a0030a78c33b46dc3fafd313cb87a91289fa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 20 Jun 2012 13:29:38 +0200 Subject: libgf_count_path_components: don't access pathdup[-1] for empty input Change-Id: I432f8c8fac907f625d79b2c5bb626a1f7013a73e BUG: 789278 Signed-off-by: Jim Meyering Reviewed-on: http://review.gluster.com/3600 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfsclient/src/libglusterfsclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index e09dc39a..3143a13e 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); -- cgit