[2.4] off-by-one kmalloc in ntfs

From: Herbert Xu
Date: Fri Feb 13 2004 - 17:59:06 EST


This patch fixes an off-by-one kmalloc bug in ntfs in 2.4.24.

Cheers,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-2.4/fs/ntfs/support.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/fs/ntfs/support.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 support.c
--- kernel-2.4/fs/ntfs/support.c 25 Feb 2002 19:38:09 -0000 1.1.1.9
+++ kernel-2.4/fs/ntfs/support.c 12 Feb 2004 11:13:29 -0000
@@ -240,7 +240,7 @@
NLS_MAX_CHARSET_SIZE)) > 0) {
/* Adjust result buffer. */
if (chl > 1) {
- buf = ntfs_malloc(*out_len + chl - 1);
+ buf = ntfs_malloc(*out_len + chl);
if (!buf) {
i = -ENOMEM;
goto err_ret;