Re: [Qemu-devel] [PATCH 03/22] vmdk: relative_path: avoid buffer overrun

2012-05-09 Thread Jim Meyering
Kevin Wolf wrote: > Am 09.05.2012 11:23, schrieb Jim Meyering: >> From: Jim Meyering >> >> strncpy does not guarantee NUL-termination. >> Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1) >> is a no-op. Use pstrcpy to ensure NUL-termination, not strncpy. > > It's not, it would onl

[Qemu-devel] [PATCH 03/22] vmdk: relative_path: avoid buffer overrun

2012-05-09 Thread Jim Meyering
From: Jim Meyering strncpy does not guarantee NUL-termination. Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1) is a no-op. Use pstrcpy to ensure NUL-termination, not strncpy. Signed-off-by: Jim Meyering --- block/vmdk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [Qemu-devel] [PATCH 03/22] vmdk: relative_path: avoid buffer overrun

2012-05-09 Thread Kevin Wolf
Am 09.05.2012 14:09, schrieb Jim Meyering: > Kevin Wolf wrote: >> Am 09.05.2012 11:23, schrieb Jim Meyering: >>> From: Jim Meyering >>> >>> strncpy does not guarantee NUL-termination. >>> Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1) >>> is a no-op. Use pstrcpy to ensure NUL-t

Re: [Qemu-devel] [PATCH 03/22] vmdk: relative_path: avoid buffer overrun

2012-05-09 Thread Kevin Wolf
Am 09.05.2012 11:23, schrieb Jim Meyering: > From: Jim Meyering > > strncpy does not guarantee NUL-termination. > Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1) > is a no-op. Use pstrcpy to ensure NUL-termination, not strncpy. It's not, it would only be a no-op before strncpy