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

Re: [Xen-devel] [PATCH v2] tools: libxenstat: fix format string overflow



On Fri, Feb 16, 2018 at 07:38:48PM +0100, Dario Faggioli wrote:
> With gcc 7.3.0, the build fails like this:
> 
> src/xenstat_linux.c: In function ‘getBridge’
> src/xenstat_linux.c:78:34: warning: ‘%s’ directive writing up to 255 bytes 
> into a region of size 241 [-Wformat-overflow=]
>      sprintf(tmp, "/sys/class/net/%s/bridge", de->d_name);
>                                   ^~
> src/xenstat_linux.c:78:5: note: ‘sprintf’ output between 23 and 278 bytes 
> into a destination of size 256
>      sprintf(tmp, "/sys/class/net/%s/bridge", de->d_name);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fix by making the buffer bigger.
> 
> Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.