aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2001-06-24 12:45:32 +0800
committernectar <nectar@FreeBSD.org>2001-06-24 12:45:32 +0800
commit6dbe628a15e91320629580a77f48a76cc9bb49ae (patch)
tree192f4fbb6bfd5dad0b861beda8652b4f7e3a434a /security
parent719f57a3c260ef0cd2d37c50a3d442b33d72104e (diff)
downloadfreebsd-ports-graphics-6dbe628a15e91320629580a77f48a76cc9bb49ae.tar.gz
freebsd-ports-graphics-6dbe628a15e91320629580a77f48a76cc9bb49ae.tar.zst
freebsd-ports-graphics-6dbe628a15e91320629580a77f48a76cc9bb49ae.zip
Bug fix for memory being free'd twice when using the new ANY:-keytabs.
PORTREVISION bumped. Submitted by: assar
Diffstat (limited to 'security')
-rw-r--r--security/heimdal/Makefile2
-rw-r--r--security/heimdal/files/patch-ab53
2 files changed, 54 insertions, 1 deletions
diff --git a/security/heimdal/Makefile b/security/heimdal/Makefile
index c0afdbac953..3c80c885b5b 100644
--- a/security/heimdal/Makefile
+++ b/security/heimdal/Makefile
@@ -7,7 +7,7 @@
PORTNAME= heimdal
PORTVERSION= 0.3f
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security ipv6
MASTER_SITES= ftp://ftp.pdc.kth.se/pub/heimdal/src/ \
ftp://ftp.replay.com/pub/replay/crypto/APPS/kerberos/heimdal/ \
diff --git a/security/heimdal/files/patch-ab b/security/heimdal/files/patch-ab
new file mode 100644
index 00000000000..9d6877f404e
--- /dev/null
+++ b/security/heimdal/files/patch-ab
@@ -0,0 +1,53 @@
+--- lib/krb5/keytab_any.c 2001/05/14 06:14:48 1.2
++++ lib/krb5/keytab_any.c 2001/06/24 01:41:04
+@@ -60,7 +60,8 @@
+ krb5_error_code ret;
+ char buf[256];
+
+- while (strsep_copy(&name, ",", buf, sizeof(buf)) != -1) {
++ while (strsep_copy(&name, ",", buf, sizeof(buf)) != -1
++ && buf[0] != '\0') {
+ a = malloc(sizeof(*a));
+ if (a == NULL) {
+ ret = ENOMEM;
+@@ -68,7 +69,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,10 +140,8 @@
+ 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 0;
+@@ -166,14 +165,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);
+