From 58c721a79b171f71862eb6a92f66f139689a747f Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Fri, 4 Aug 2017 11:34:47 -0400 Subject: [PATCH] LU-9829 lnet: Properly dereference string pointer A bug highlighted by newer gcc. We really need to be doing double dereference of the next pointer looking for end of string, since the pointer is double indirect. Change-Id: Id80522f43606a843383787d71eec1ddf00af5269 Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/28358 Tested-by: Jenkins Reviewed-by: Patrick Farrell Tested-by: Maloo Reviewed-by: James Simmons --- libcfs/libcfs/util/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcfs/libcfs/util/parser.c b/libcfs/libcfs/util/parser.c index b92d8dc..0855df3 100644 --- a/libcfs/libcfs/util/parser.c +++ b/libcfs/libcfs/util/parser.c @@ -195,7 +195,7 @@ got_it: if ((*result)->pc_func != NULL) { return CMD_COMPLETE; } else { - if (*next == '\0') { + if (**next == '\0') { return CMD_INCOMPLETE; } else { return process(*next, next, (*result)->pc_sub_cmd, -- 1.8.3.1