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

Truncation of output string in lsnapshot.c::jt_snapshot_create

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      This is highlighted by modern gcc and I guess not so important in the end, but the warnng breaks the compile:

      lsnapshot.c: In function Б─≤jt_snapshot_createБ─≥:
      lsnapshot.c:1328:31: error: Б─≤snprintfБ─≥ output truncated before the last format character [-Werror=format-truncation=]
        snprintf(new_fsname, 8, "%08x", (__u32)random());
                                     ^
      lsnapshot.c:1328:2: note: Б─≤snprintfБ─≥ output 9 bytes into a destination of size 8
        snprintf(new_fsname, 8, "%08x", (__u32)random());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

            wc-triage WC Triage
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: