diff options
author | Ravishankar N <ravishankar@redhat.com> | 2013-07-08 15:45:54 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-12 04:14:12 -0700 |
commit | 07833f13d43a3e3532171bb2edbe068e3a7205b1 (patch) | |
tree | 257e92d04fabce1b7968a5b68ea3d5494f5ef2b1 /cli | |
parent | ec64f13476cbd2f7702cecfef929f3ea8efc0a51 (diff) |
cli: check for null in is_server_debug_xlator()
Command: gluster volume set <volname> 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 <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/5298
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 5ae4cfbc83f..ff0e83cb5c9 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1545,6 +1545,8 @@ is_server_debug_xlator (void *myframe) key = *words; words++; value = *words; + if (value == NULL) + break; if (strstr (value, "client")) { words++; continue; |