Details

    • Bug
    • Resolution: Not a Bug
    • Minor
    • Lustre 2.7.0
    • Lustre 2.7.0
    • 3
    • 16412

    Description

      In commit 979203503af2f77d51bcf27375a1a09f5f28a4a3 (LU-4665 utils: lfs setstripe to specify OSTs) was introduced suspicious dereference of pointer 'ptr' before NULL check at line 704.

      Attachments

        Issue Links

          Activity

            [LU-5864] New static analysis issues in lfs
            ptr = strchrnul(arg, ',');
            end_of_loop = *ptr == '\0';
            *ptr = '\0';
            

            According manual:

            The strchrnul() function is like strchr() except that if c is not found in s, then it returns a pointer to the null byte at the end of s, rather than NULL.

            Therefore ptr can not by NULL here. It's false positive of static analysis tool.

            dmiter Dmitry Eremin (Inactive) added a comment - ptr = strchrnul(arg, ',' ); end_of_loop = *ptr == '\0' ; *ptr = '\0' ; According manual: The strchrnul() function is like strchr() except that if c is not found in s, then it returns a pointer to the null byte at the end of s, rather than NULL. Therefore ptr can not by NULL here. It's false positive of static analysis tool.

            People

              dmiter Dmitry Eremin (Inactive)
              dmiter Dmitry Eremin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: