Re: [Xen-devel] [PATCH] tools: libxl: NULL terminate partially constructed hex string

2016-02-16 Thread Ian Jackson
Wei Liu writes ("Re: [PATCH] tools: libxl: NULL terminate partially constructed hex string"): > On Tue, Feb 16, 2016 at 11:18:20AM +, Ian Campbell wrote: > > Coverity (correctly) complains that the strncpy(p, "0x", 2) will not > > null terminate p. > > Signed-off-by: Ian Campbell > > Acked-b

Re: [Xen-devel] [PATCH] tools: libxl: NULL terminate partially constructed hex string

2016-02-16 Thread Wei Liu
On Tue, Feb 16, 2016 at 11:18:20AM +, Ian Campbell wrote: > Coverity (correctly) complains that the strncpy(p, "0x", 2) will not > null terminate p. > > Although we can see that in the rest of the function p will > definitely be NULL terminated by the time it is complete there is no > harm in

[Xen-devel] [PATCH] tools: libxl: NULL terminate partially constructed hex string

2016-02-16 Thread Ian Campbell
Coverity (correctly) complains that the strncpy(p, "0x", 2) will not null terminate p. Although we can see that in the rest of the function p will definitely be NULL terminated by the time it is complete there is no harm in passing 3 to the strncpy and allowing it to NULL terminate to placate Cove