fab64b
From a609a605d87b3107de64141cd3d60c2a73c7b38f Mon Sep 17 00:00:00 2001
fab64b
From: Robbie Harwood <rharwood@redhat.com>
fab64b
Date: Fri, 22 Apr 2016 09:59:22 -0400
fab64b
Subject: [PATCH] krb5-1.12-api.patch
5af5b2
fab64b
---
fab64b
 src/lib/krb5/krb/princ_comp.c | 7 +++++++
fab64b
 1 file changed, 7 insertions(+)
fab64b
fab64b
diff --git a/src/lib/krb5/krb/princ_comp.c b/src/lib/krb5/krb/princ_comp.c
fab64b
index a6936107d..0ed78833b 100644
fab64b
--- a/src/lib/krb5/krb/princ_comp.c
fab64b
+++ b/src/lib/krb5/krb/princ_comp.c
fab64b
@@ -36,6 +36,10 @@ realm_compare_flags(krb5_context context,
4be148
     const krb5_data *realm1 = &princ1->realm;
4be148
     const krb5_data *realm2 = &princ2->realm;
5af5b2
 
4be148
+    if (princ1 == NULL || princ2 == NULL)
5af5b2
+        return FALSE;
4be148
+    if (realm1 == NULL || realm2 == NULL)
5af5b2
+        return FALSE;
5af5b2
     if (realm1->length != realm2->length)
5af5b2
         return FALSE;
4be148
     if (realm1->length == 0)
fab64b
@@ -88,6 +92,9 @@ krb5_principal_compare_flags(krb5_context context,
5af5b2
     krb5_principal upn2 = NULL;
5af5b2
     krb5_boolean ret = FALSE;
5af5b2
 
4be148
+    if (princ1 == NULL || princ2 == NULL)
5af5b2
+        return FALSE;
5af5b2
+
5af5b2
     if (flags & KRB5_PRINCIPAL_COMPARE_ENTERPRISE) {
5af5b2
         /* Treat UPNs as if they were real principals */
4be148
         if (princ1->type == KRB5_NT_ENTERPRISE_PRINCIPAL) {