Problem with expansion of %{Ldap-UserDn} containing UTF-8 (cf. Bug #411)

Enrik Berkhan enrik#freeradius at planb.de
Tue Aug 28 11:20:39 CEST 2007


Hi,

Alan DeKok wrote:
> Enrik Berkhan wrote:
>> - I'd add a length parameter and check for str to utf8_char().
> 
>   Not needed.  The C string termination character '\0' is not a valid
> UTF-8 character.

You're right, if it's guaranteed to be called with a terminated string. 
You might add a comment, though :)

>> I think with a little fixing this can make it into HEAD and 1.1.x to be
>> tested by others.
> 
>   Please try the following patch.  It's a little clearer.

It works ok with the same little test and actually it is a lot cleaner now.

The 'done' counter in librad_safeprint() is not needed AFAICS as 
'outlen' is decremented each time 'done' is incremented. Thus, the 
condition at the top while loop is wrong.

Enrik




More information about the Freeradius-Devel mailing list