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

2014-10-24 Thread Michael Tokarev
On 10/13/2014 06:47 PM, Alexander Graf wrote: 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

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

2014-10-24 Thread Alexander Graf
Am 24.10.2014 um 09:49 schrieb Michael Tokarev m...@tls.msk.ru: On 10/13/2014 06:47 PM, Alexander Graf wrote: 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

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

2014-10-24 Thread Chen Gang
On 10/24/14 15:49, Michael Tokarev wrote: On 10/13/2014 06:47 PM, Alexander Graf wrote: 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.

[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 gang.chen.5...@gmail.com --- target-ppc/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [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 gang.chen.5...@gmail.com I agree with this patch. However,

Re: [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