Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12861

Add and use scnprintf() where using snprintf() is not handling return correctly

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Minor
    • Lustre 2.14.0
    • None
    • None
    • 9223372036854775807

    Description

      There are a few locations where the return value of snprintf() is being used and not checked against the maximum number of characters in the buffer.

      scnprintf() is nearly identical to snprintf() except the return value for scnprintf() is the number of characters written to the buffer (not including the terminating null).

      Where as snprintf() returns the number of characters that would have been written to the buffer, if there was no restriction. Alternatively stated the return value is the size of buffer needed to hold the complete result (not including the terminating null).

      Add scnprintf() wrapper around snprintf() and start using it.

       

      Attachments

        Issue Links

          Activity

            People

              stancheff Shaun Tancheff
              stancheff Shaun Tancheff
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: