Whamcloud - gitweb
LU-15130 nrs: null pointer dereference in nrs_tbf_id_parse
[fs/lustre-release.git] / libcfs / libcfs / util / string.c
index 9e92339..700f002 100644 (file)
@@ -84,6 +84,7 @@ cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res)
                /* there is no the delimeter in the string */
                end = next->ls_str + next->ls_len;
                next->ls_str = NULL;
+               next->ls_len = 0;
        } else {
                next->ls_str = end + 1;
                next->ls_len -= (end - res->ls_str + 1);