Fix bug in realm encoding reported by Mark Pröhl

Also, add basic test while here.
This commit is contained in:
Love Hornquist Astrand
2011-05-08 11:22:07 -07:00
parent 77c7747cc3
commit be92276b8b
3 changed files with 113 additions and 2 deletions

View File

@@ -410,7 +410,7 @@ krb5_domain_x500_encode(char **realms, unsigned int num_realms,
return ENOMEM;
*s = '\0';
for(i = 0; i < num_realms; i++){
if(i && i < num_realms - 1)
if(i)
strlcat(s, ",", len + 1);
if(realms[i][0] == '/')
strlcat(s, " ", len + 1);