Re: [Qemu-devel] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-13 Thread Chen Gang
On 10/13/14 22:47, Alexander Graf wrote: > > Could you please instead rewrite it to use g_strdup_printf() rather than > strncat()s? That way we resolve all string pitfalls automatically - and > this code is not the fast path, so doing an extra memory allocation is ok. > I guess, it is a personal

Re: [Qemu-devel] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-13 Thread Alexander Graf
On 13.10.14 16:36, Chen Gang wrote: > strncat() will append additional '\0' to destination buffer, so need > additional 1 byte for it, or may cause memory overflow, just like other > area within QEMU have done. > > Signed-off-by: Chen Gang I agree with this patch. However, the code is pretty u

[Qemu-devel] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-13 Thread Chen Gang
strncat() will append additional '\0' to destination buffer, so need additional 1 byte for it, or may cause memory overflow, just like other area within QEMU have done. Signed-off-by: Chen Gang --- target-ppc/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-pp