diff mbox

[linux-cifs-client,2/5] cifs: Fix cifs_strfromUCS_le to do double-byte NULL termination

Message ID 49EF1EF5.8060008@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Suresh Jayaraman April 22, 2009, 1:43 p.m. UTC
Ensure NULL termination (double-byte) is done here and prevent callers
from doing incorrect NULL termination.

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
---
 fs/cifs/cifs_unicode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

linux-cifs-client mailing list
linux-cifs-client@lists.samba.org
https://lists.samba.org/mailman/listinfo/linux-cifs-client
diff mbox

Patch

diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 7d75272..e7ed048 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -51,6 +51,8 @@  cifs_strfromUCS_le(char *to, const __le16 *from,
 		}
 	}
 	to[outlen] = 0;
+	/* ensure double-byte NULL termination */
+	to[outlen + 1] = 0;
 	return outlen;
 }
_______________________________________________