On 11/25/2014 04:48 PM, Lukas Slebodnik wrote:
On (25/11/14 16:32), Pavel Reichl wrote:
On 11/25/2014 03:33 PM, Lukas Slebodnik wrote:
On (14/10/14 14:44), Lukas Slebodnik wrote:
On (14/10/14 14:14), Pavel Reichl wrote:
On 10/14/2014 01:59 PM, Lukas Slebodnik wrote:
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index b4012593d96bc951143e4bb2ba7a91d118b1a53c..7daedb47464917966350f94c7d5b0844ccee7edb 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -834,8 +834,15 @@ void sss_krb5_get_init_creds_opt_set_canonicalize(krb5_get_init_creds_opt *opts,
 void sss_krb5_princ_realm(krb5_context context, krb5_const_principal princ,
                           const char **realm, int *len)
-    *realm = krb5_principal_get_realm(context, princ);
-    *len = strlen(*realm);
+    const char *realm_str = krb5_principal_get_realm(context, princ);
+    if (realm_str != NULL) {
+        *realm = krb5_principal_get_realm(context, princ);
Why do we have to call krb5_principal_get_realm() again here? Why can't we
just reuse value in realm_str?

I just forgot to squash changes before sending patches.

Updated version is attached.

Attached are updated patches which can be applied on current master.


I think you rebased wrong patch - there were some changes which are not in
this patch - you can see my prev post and you reaction to see what I mean.

I just sent wrong patch. The problematic was the 2nd patch.


sssd-devel mailing list
LGTM, builds fine. ACK