if the sids are not the same pointer and either of the sids are NULL
authorAndrew Tridgell <tridge@samba.org>
Tue, 25 Jul 2000 20:26:50 +0000 (20:26 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 25 Jul 2000 20:26:50 +0000 (20:26 +0000)
then the two sids are not equal

source/lib/util_sid.c

index 42fdfb15fe7158e367c4441f0aab771463bccb0f..3572f2c775d4a94ffc96fa95f30596fdc59df82e 100644 (file)
@@ -404,6 +404,9 @@ BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2)
 {
        int i;
 
+       if (sid1 == sid2) return True;
+       if (!sid1 || !sid2) return False;
+
        /* compare most likely different rids, first: i.e start at end */
        for (i = sid1->num_auths-1; i >= 0; --i)
                if (sid1->sub_auths[i] != sid2->sub_auths[i])