Re: [PATCH rdma-core] srp_daemon: Increase buffer size to avoid snprintf overflow

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

 



On Sat, May 26, 2018 at 12:33:58AM +0300, Leon Romanovsky wrote:
> On Fri, May 25, 2018 at 03:20:24PM -0600, Jason Gunthorpe wrote:
> > The latest gcc in tumbleweed reports:
> >
> > ../srp_daemon/srp_daemon.c: In function 'get_shared_pkeys':
> > ../srp_daemon/srp_daemon.c:1080:50: warning: '__builtin___snprintf_chk' output may be truncated before the last format character [-Wformat-truncation=]
> >   snprintf(pkey_file, sizeof(pkey_file), "pkeys/%d", pkey_index);
> >
> > The given format string requires 18 bytes to handle all expansions of %d
> >
> > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >  srp_daemon/srp_daemon.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> 
> Out of curiosity, what is the exact version of gcc?

It claims to be 7.3.1 but suse has obviously patched it in some way
since older versions of suse 7.3.1 don't have these warnings.

Jason

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux