Whamcloud - gitweb
LU-9829 lnet: Properly dereference string pointer 58/28358/2
authorOleg Drokin <oleg.drokin@intel.com>
Fri, 4 Aug 2017 15:34:47 +0000 (11:34 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 17 Aug 2017 01:30:22 +0000 (01:30 +0000)
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 <oleg.drokin@intel.com>
Reviewed-on: https://review.whamcloud.com/28358
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
libcfs/libcfs/util/parser.c

index b92d8dc..0855df3 100644 (file)
@@ -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,