File: 0001-krb5_principal_compare-crashes-on-NULL-arguments.patch

package info (click to toggle)
krb5-auth-dialog 3.2.1-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,872 kB
  • sloc: sh: 11,320; ansic: 4,639; xml: 1,568; makefile: 292; lex: 159; python: 58; yacc: 42
file content (26 lines) | stat: -rw-r--r-- 929 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Petter Reinholdtsen <pere@hungry.com>
Date: Thu, 4 Jul 2013 09:32:18 +0200
Subject: krb5_principal_compare crashes on NULL arguments

Debian Bug #714825
---
 src/ka-kerberos.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ka-kerberos.c b/src/ka-kerberos.c
index db5cddd..0867234 100644
--- a/src/ka-kerberos.c
+++ b/src/ka-kerberos.c
@@ -221,8 +221,10 @@ credentials_expiring_real (KaApplet *applet)
     }
 
     /* copy principal from cache if any */
-    if (krb5_principal_compare (kcontext, my_creds.client, kprincipal)) {
-        krb5_free_principal (kcontext, kprincipal);
+    if (kprincipal == NULL ||
+        krb5_principal_compare (kcontext, my_creds.client, kprincipal)) {
+        if (kprincipal)
+            krb5_free_principal (kcontext, kprincipal);
         krb5_copy_principal (kcontext, my_creds.client, &kprincipal);
     }
     creds_expiry = my_creds.times.endtime;