From: Oleg Drokin Date: Fri, 4 Aug 2017 15:34:47 +0000 (-0400) Subject: LU-9829 lnet: Properly dereference string pointer X-Git-Tag: 2.10.52~10 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F28358%2F2;p=fs%2Flustre-release.git 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 --- 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,