GSS_C_NO_OID matches nothing, not even it-self, document function

This commit is contained in:
Love Hornquist Astrand
2010-03-30 11:18:49 -07:00
parent aa371571f9
commit 312f4f9bd6

View File

@@ -33,10 +33,24 @@
#include "mech_locl.h"
/**
* Compare two GSS-API OIDs with each other.
*
* GSS_C_NO_OID matches nothing, not even it-self.
*
* @param a first oid to compare
* @param b second oid to compare
*
* @return zero when both oid are the same OID, non-zero when they are
* not the same.
*
* @ingroup gssapi
*/
int GSSAPI_LIB_FUNCTION
gss_oid_equal(const gss_OID a, const gss_OID b)
{
if (a == b)
if (a == b && a != GSS_C_NO_OID)
return 1;
if (a == GSS_C_NO_OID || b == GSS_C_NO_OID || a->length != b->length)
return 0;