5 messages in com.xensource.lists.xen-develRe: [Xen-devel] [PATCH] Use string bo...
FromSent OnAttachments
Christoph Egger29 Jan 2007 02:10.diff
Keir Fraser29 Jan 2007 02:52 
Christoph Egger29 Jan 2007 03:10 
Jimi Xenidis29 Jan 2007 05:41 
Keir Fraser29 Jan 2007 05:48 
Subject:Re: [Xen-devel] [PATCH] Use string bounded functions
From:Keir Fraser (ke@xensource.com)
Date:01/29/2007 02:52:19 AM
List:com.xensource.lists.xen-devel

On 29/1/07 10:10, "Christoph Egger" <Chri@amd.com> wrote:

The attached patch replaces sprintf with snprintf and strncpy with strlcpy.

There are various cases where no NULL-terminated strings are guaranteed and eventual possible overflows. This patch fixes them.

BTW: Since Xen kernel has its own string functions, can't we just remove sprintf() and strncpy()? IMO, Xen should not inherit the historical C relicts.

This makes plenty of sense. Strncpy() in particular is dangerous and strlcpy() is always preferable. So I'd be happy to see strncat/strncpy die.

There are a few uses remaining (particularly in arch/ia64) that you'll have to fix first.

And please add 'signed-off-by' attribution when you post patches!

-- Keir