ia64/xen-unstable

changeset 13258:98dadb3df5ca

[linux] Fix vsnprintf patch not to write null byte past the end of the buffer.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Thu Jan 04 15:50:08 2007 +0000 (2007-01-04)
parents 48c9028e6f8e
children d03beab5e1ad
files patches/linux-2.6.16.33/vsnprintf.patch
line diff
     1.1 --- a/patches/linux-2.6.16.33/vsnprintf.patch	Thu Jan 04 15:32:26 2007 +0000
     1.2 +++ b/patches/linux-2.6.16.33/vsnprintf.patch	Thu Jan 04 15:50:08 2007 +0000
     1.3 @@ -203,7 +203,7 @@ index b07db5c..f595947 100644
     1.4  +		if (str < end)
     1.5  +			*str = '\0';
     1.6  +		else
     1.7 -+			*end = '\0';
     1.8 ++			end[-1] = '\0';
     1.9  +	}
    1.10  +	/* the trailing null byte doesn't count towards the total */
    1.11   	return str-buf;