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

Re: Heimdal, gssapi, cyrus-sasl, segmentation fault



Brian May <bam@snoopy.apana.org.au> writes:
> when running the gssapi module of sasl (1.5.15), it frequently causes
> segmention fault. I have diagnosed the problem, but do not know what
> library is at fault.

It's Heimdal's fault.  It should be able to handle output_token ==
0x0.  The trivial patch is appended.

/assar

Index: delete_sec_context.c
===================================================================
RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/heimdal/lib/gssapi/delete_sec_context.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -w -r1.5 -r1.6
--- delete_sec_context.c	1999/12/26 18:31:06	1.5
+++ delete_sec_context.c	2000/01/26 00:45:46	1.6
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997 - 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden). 
  * All rights reserved. 
  *
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: delete_sec_context.c,v 1.5 1999/12/26 18:31:06 assar Exp $");
+RCSID("$Id: delete_sec_context.c,v 1.6 2000/01/26 00:45:46 assar Exp $");
 
 OM_uint32 gss_delete_sec_context
            (OM_uint32 * minor_status,
@@ -43,8 +43,10 @@
 {
   gssapi_krb5_init ();
 
+  if (output_token) {
   output_token->length = 0;
   output_token->value  = NULL;
+  }
 
   krb5_auth_con_free (gssapi_krb5_context,
 		      (*context_handle)->auth_context);
@@ -58,7 +60,5 @@
     krb5_free_ticket (gssapi_krb5_context,
 		      (*context_handle)->ticket);
   free (*context_handle);
-  if (output_token)
-    output_token->length = 0;
   return GSS_S_COMPLETE;
 }