[gnome-online-accounts] identity: Don't ever nullify identifier



commit d8e36c5b2f1762ab4eea6262225c753ff7711f3c
Author: Ray Strode <rstrode redhat com>
Date:   Tue Sep 22 14:41:05 2015 -0400

    identity: Don't ever nullify identifier
    
    Credentials stored in the kernel keyring disappear after they expire.
    This is different from other credential caches, which hang around but
    maintain an expired timestamp until kdestroy. Because the credentials
    vanish, trying to read the principal from an previously existing
    credential cache will yield NULL.
    
    This can lead to a crash because we never expect the identifier of an
    identity object to be NULL. So make sure we retain the old identifier
    in the event the credential cache gets wiped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756494

 src/goaidentity/goakerberosidentity.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c
index 4370a09..1ce5079 100644
--- a/src/goaidentity/goakerberosidentity.c
+++ b/src/goaidentity/goakerberosidentity.c
@@ -1345,7 +1345,7 @@ update_identifier (GoaKerberosIdentity *self, GoaKerberosIdentity *new_identity)
   char *new_identifier;
 
   new_identifier = get_identifier (self, NULL);
-  if (g_strcmp0 (self->priv->identifier, new_identifier) != 0)
+  if (g_strcmp0 (self->priv->identifier, new_identifier) != 0 && new_identifier != NULL)
     {
       g_free (self->priv->identifier);
       self->priv->identifier = new_identifier;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]