Jeff noticed a typo in your patch (maxword -&gt; 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">&lt;<a href="mailto:roel.kluin@gmail.com">roel.kluin@gmail.com</a>&gt;</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 &lt;<a href="mailto:roel.kluin@gmail.com">roel.kluin@gmail.com</a>&gt;<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] &amp;&amp; i &lt; maxwords; i++) {<br>
+       for (i = 0; i &lt; maxword &amp;&amp; from[i]; i++) {<br>
                charlen = codepage-&gt;uni2char(le16_to_cpu(from[i]), tmp,<br>
                                             NLS_MAX_CHARSET_SIZE);<br>
                if (charlen &gt; 0)<br>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br><br>Steve<br>