[krbdev.mit.edu #6777] Segmentation fault in krb library (sn2princ.c) if realm not resolved

Greg Hudson via RT rt-comment at krbdev.mit.edu
Tue Sep 14 18:07:29 EDT 2010


[Richard.Krier at globalfoundries.com - Tue Sep 14 15:10:55 2010]:
>               2. If realm unresolved, krb5_get_host_realm() returns a
> zero-length string, i.e. 1 byte containing just '\0'

This is not actually an error condition.  The empty string is returned 
here to indicate that the caller should try referrals.  So step 3 is 
actually correct.

>               3. sname_to_princ() then calls krb5_build_principal(),
> principal not created in this case, *ret_princ is NULL
> ALSO HERE:       No check is made to determine if *ret_princ is NULL
> before using it to make an assignment as point 4.

Failing to check retval here is a bug, and we'll fix it.  However, 
krb5_build_principal() should succeed in the scenario you described; I 
would be interested to know why it is failing in your use case.



More information about the krb5-bugs mailing list