Jeff noticed a typo in your patch (maxword -> maxwords) - I will fix and merge<br><br><div class="gmail_quote">On Sun, Aug 2, 2009 at 6:00 AM, Roel Kluin <span dir="ltr"><<a href="mailto:roel.kluin@gmail.com">roel.kluin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Check whether index is within bounds before testing the element.<br>
<br>
Signed-off-by: Roel Kluin <<a href="mailto:roel.kluin@gmail.com">roel.kluin@gmail.com</a>><br>
---<br>
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c<br>
index 60e3c42..cfdb831 100644<br>
--- a/fs/cifs/cifs_unicode.c<br>
+++ b/fs/cifs/cifs_unicode.c<br>
@@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,<br>
int maxwords = maxbytes / 2;<br>
char tmp[NLS_MAX_CHARSET_SIZE];<br>
<br>
- for (i = 0; from[i] && i < maxwords; i++) {<br>
+ for (i = 0; i < maxword && from[i]; i++) {<br>
charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,<br>
NLS_MAX_CHARSET_SIZE);<br>
if (charlen > 0)<br>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br><br>Steve<br>