summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-14 12:00:56 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-14 12:02:53 +0100
commite59d958a9c9a509ce34ca553a5b1b03e406d561f (patch)
tree543a83fc823d4648e48e8d3a688b0efdefc513c6 /gnu/packages
parent641b9c51b7f21ecf7e3eeca6d3c2c0ceb14c9027 (diff)
gnu: mit-krb5: Fix segfault in gsasl test suite.
* gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/kerberos.scm (mit-krb5)[source](patches): New field.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/kerberos.scm1
-rw-r--r--gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch29
2 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/kerberos.scm b/gnu/packages/kerberos.scm
index af3a0d18b2..0e290c0d46 100644
--- a/gnu/packages/kerberos.scm
+++ b/gnu/packages/kerberos.scm
@@ -60,6 +60,7 @@
(string-append "https://kerberos.org/dist/krb5/"
(version-major+minor version)
"/krb5-" version ".tar.gz")))
+ (patches (search-patches "mit-krb5-qualify-short-hostnames.patch"))
(sha256
(base32
"121c5xsy3x0i4wdkrpw62yhvji6virbh6n30ypazkp0isws3k4bk"))))
diff --git a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
new file mode 100644
index 0000000000..491a358731
--- /dev/null
+++ b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
@@ -0,0 +1,29 @@
+Fix a null pointer dereference when no DNS search path is configured.
+This showed up as a segfault while running the gsasl test suite.
+
+Taken from upstream:
+https://github.com/krb5/krb5/commit/cd82bf377e7fad2409c76bf8b241920692f34fda
+
+diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
+index e35ca9d76c..0cd213fdd7 100644
+--- a/src/lib/krb5/os/dnsglue.c
++++ b/src/lib/krb5/os/dnsglue.c
+@@ -91,7 +91,7 @@ static int initparse(struct krb5int_dns_state *);
+ #define DECLARE_HANDLE(h) struct __res_state h
+ #define INIT_HANDLE(h) (memset(&h, 0, sizeof(h)), res_ninit(&h) == 0)
+ #define SEARCH(h, n, c, t, a, l) res_nsearch(&h, n, c, t, a, l)
+-#define PRIMARY_DOMAIN(h) strdup(h.dnsrch[0])
++#define PRIMARY_DOMAIN(h) ((h.dnsrch[0] == NULL) ? NULL : strdup(h.dnsrch[0]))
+ #if HAVE_RES_NDESTROY
+ #define DESTROY_HANDLE(h) res_ndestroy(&h)
+ #else
+@@ -104,7 +104,8 @@ static int initparse(struct krb5int_dns_state *);
+ #define DECLARE_HANDLE(h)
+ #define INIT_HANDLE(h) (res_init() == 0)
+ #define SEARCH(h, n, c, t, a, l) res_search(n, c, t, a, l)
+-#define PRIMARY_DOMAIN(h) strdup(_res.defdname)
++#define PRIMARY_DOMAIN(h) \
++ ((_res.defdname == NULL) ? NULL : strdup(_res.defdname))
+ #define DESTROY_HANDLE(h)
+
+ #endif