[Samba] Conversion error: Illegal multibyte sequence

Laurent Blume laurent+samba at elanor.org
Fri Sep 6 18:02:26 MDT 2013


On 2013-09-06 10:54 PM, Jeremy Allison wrote:

> Either that or add another debug inside
> convert_string_internal() to print out
> the values of srclen and i_len at various
> points and try and determine why it's off
> by one.

Well, it was /quite/ further than that.

I think I got it this time, in sources3/smbd/mangle_hash2.c:

                       /*
                         * Note that if CH_UNIX is utf8 a string may be 3
                         * bytes, but this is ok as mb utf8 characters don't
                         * contain embedded ascii bytes. We are really
checking
                         * for mb UNIX asian characters like Japanese
(SJIS) here.
                         * JRA.
                         */
                        DEBUG(3, ("DEBUG ++ name, %s\n", name));
>>>>                        if (convert_string(CH_UNIX, CH_UTF16LE,
name, 2, mbc, 2, False) == 2) {
                                /* Was a good mb string. */
                                name += 2;
                                continue;
                        }
                        DEBUG(3, ("DEBUG -- name, %s\n", name));


Why is the length here hardcoded to 2?

It's past 2am around here, so I could be missing something, time for bed.

Thanks,

Laurent



More information about the samba mailing list