Re: [PATCH 5/6] misc: fix gcc-7 snprintf warnings -Wformat-truncation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



BTW there is another of these warnings left, see below. I'm not sure here what
to do. Note, it's pssible to silent this warning also by _using_ snprintf's
return value.

../libblkid/src/partitions/partitions.c:1371:45: warning: '%02x' directive output may be truncated writing between 2 and 8 bytes into a region of size between 0 and 36 [-Wformat-truncation=]
  snprintf(par->uuid, sizeof(par->uuid), "%s-%02x",
                                             ^~~~
../libblkid/src/partitions/partitions.c:1371:41: note: using the range [0, 4294967295] for directive argument
  snprintf(par->uuid, sizeof(par->uuid), "%s-%02x",
                                         ^~~~~~~~~
../libblkid/src/partitions/partitions.c:1371:2: note: 'snprintf' output between 4 and 46 bytes into a destination of size 37
  snprintf(par->uuid, sizeof(par->uuid), "%s-%02x",
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    par->tab->id, par->partno);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux