[Samba] Conversion error: Illegal multibyte sequence

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Sep 10 03:43:40 MDT 2013


Hi, Jeremy!

On Mon, Sep 09, 2013 at 03:40:06PM -0700, Jeremy Allison wrote:
> Ok, here is a fix for 3.6.x. Can you test this and see
> if it fixes the problem ? If so, I'll get this fixed
> in master and back-ported to all releases.
> 
> Thanks !
> 
> Jeremy.

> diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
> index 5aafe2f..e1aedf1 100644
> --- a/source3/smbd/mangle_hash2.c
> +++ b/source3/smbd/mangle_hash2.c
> @@ -626,7 +626,8 @@ static bool is_legal_name(const char *name)
>  	while (*name) {
>  		if (((unsigned int)name[0]) > 128 && (name[1] != 0)) {
>  			/* Possible start of mb character. */
> -			char mbc[2];
> +			size_t size = 0;
> +			(void)next_codepoint(name, &size);
>  			/*
>  			 * Note that if CH_UNIX is utf8 a string may be 3
>  			 * bytes, but this is ok as mb utf8 characters don't
> @@ -634,7 +635,7 @@ static bool is_legal_name(const char *name)
>  			 * for mb UNIX asian characters like Japanese (SJIS) here.
>  			 * JRA.
>  			 */
> -			if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2, False) == 2) {
> +			if (size == 2) {
>  				/* Was a good mb string. */
>  				name += 2;
>  				continue;

Can you explain what this check is supposed to do at all? I
don't get it ... :-)

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

*****************************************************************
visit us on it-sa:IT security exhibitions in Nürnberg, Germany
October 8th - 10th 2013, hall 12, booth 333
free tickets available via code 270691 on: www.it-sa.de/gutschein
******************************************************************


More information about the samba mailing list