[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: segmentation fault
Can you try the appended patch? I think it should solve these
problems.
/assar
Index: keytab_any.c
===================================================================
RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/heimdal/lib/krb5/keytab_any.c,v
retrieving revision 1.2
retrieving revision 1.4
diff -u -w -u -w -r1.2 -r1.4
--- keytab_any.c 2001/05/14 06:14:48 1.2
+++ keytab_any.c 2001/06/24 02:22:33 1.4
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: keytab_any.c,v 1.2 2001/05/14 06:14:48 assar Exp $");
+RCSID("$Id: keytab_any.c,v 1.4 2001/06/24 02:22:33 assar Exp $");
struct any_data {
krb5_keytab kt;
@@ -68,7 +68,7 @@
}
if (a0 == NULL) {
a0 = a;
- a->name = strdup(name);
+ a->name = strdup(buf);
if (a->name == NULL) {
krb5_set_error_string(context, "malloc: out of memory");
ret = ENOMEM;
@@ -139,11 +139,9 @@
ed->a = a;
ret = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor);
if (ret) {
- free (ed);
free (c->data);
c->data = NULL;
- krb5_set_error_string (context, "malloc: out of memory");
- return ENOMEM;
+ return ret;
}
return 0;
}
@@ -166,14 +164,15 @@
ret2 = krb5_kt_end_seq_get (context, ed->a->kt, &ed->cursor);
if (ret2)
return ret2;
- ed->a = ed->a->next;
+ while ((ed->a = ed->a->next) != NULL) {
+ ret2 = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor);
+ if (ret2 == 0)
+ break;
+ }
if (ed->a == NULL) {
krb5_clear_error_string (context);
return KRB5_CC_END;
}
- ret2 = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor);
- if (ret2)
- return ret2;
} else
return ret;
} while (ret == KRB5_CC_END);