From f7f12d1fc644e400eec58944a24c7f7b16f41530 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Mon, 8 Jul 2013 15:45:54 +0530 Subject: cli: check for null in is_server_debug_xlator() Command: gluster volume set diagnostics.client-log-level trace Expected output: "volume set: failed: option log-level trace: 'trace' is not valid (possible options are DEBUG, WARNING, ERROR, INFO, CRITICAL, NONE, TRACE.)" Current output: gluster cli receives a segmentation fault Fix: check for NULL before calling strstr Change-Id: If4c7a85a635849a388cf122543e12349c109643c BUG: 982174 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/5298 Reviewed-by: Kaushal M Tested-by: Gluster Build System Reviewed-on: http://review.gluster.org/5814 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Anand Avati --- cli/src/cli-rpc-ops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ca96ae871..5a13ff165 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1560,6 +1560,8 @@ is_server_debug_xlator (void *myframe) key = *words; words++; value = *words; + if (value == NULL) + break; if (strstr (value, "client")) { words++; continue; -- cgit