diff --git a/0009-Fix-null-dereference-qualifying-short-hostnames.patch b/0009-Fix-null-dereference-qualifying-short-hostnames.patch new file mode 100644 index 0000000..486cae6 --- /dev/null +++ b/0009-Fix-null-dereference-qualifying-short-hostnames.patch @@ -0,0 +1,43 @@ +From 96d0ee0760a1c7cf735d04fbddf095a4c01ef190 Mon Sep 17 00:00:00 2001 +From: Greg Hudson +Date: Tue, 3 Mar 2020 12:27:02 -0500 +Subject: [PATCH] Fix null dereference qualifying short hostnames + +Fix the dnsglue.c PRIMARY_DOMAIN macro not to call strdup() with a +null pointer if no DNS search path is configured. + +ticket: 8881 +tags: pullup +target_version: 1.18-next + +(cherry picked from commit cd82bf377e7fad2409c76bf8b241920692f34fda) +--- + src/lib/krb5/os/dnsglue.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c +index e35ca9d76..0cd213fdd 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 +-- +2.25.1 + diff --git a/krb5-mini.changes b/krb5-mini.changes index 3e0f75c..b1c4ed2 100644 --- a/krb5-mini.changes +++ b/krb5-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 25 09:20:38 UTC 2020 - Samuel Cabrero + +- Fix segfault in k5_primary_domain; (bsc#1167620); +- Added patches: + * 0009-Fix-null-dereference-qualifying-short-hostnames.patch + ------------------------------------------------------------------- Tue Feb 25 08:36:37 UTC 2020 - Tomáš Chvátal diff --git a/krb5-mini.spec b/krb5-mini.spec index 8667839..2341894 100644 --- a/krb5-mini.spec +++ b/krb5-mini.spec @@ -44,6 +44,7 @@ Patch5: 0005-krb5-1.6.3-ktutil-manpage.patch Patch6: 0006-krb5-1.12-api.patch Patch7: 0007-SELinux-integration.patch Patch8: 0008-krb5-1.9-debuginfo.patch +Patch9: 0009-Fix-null-dereference-qualifying-short-hostnames.patch BuildRequires: autoconf BuildRequires: bison BuildRequires: keyutils diff --git a/krb5.changes b/krb5.changes index 9f40b15..308df17 100644 --- a/krb5.changes +++ b/krb5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 25 09:20:38 UTC 2020 - Samuel Cabrero + +- Fix segfault in k5_primary_domain; (bsc#1167620); +- Added patches: + * 0009-Fix-null-dereference-qualifying-short-hostnames.patch + ------------------------------------------------------------------- Tue Feb 25 08:36:37 UTC 2020 - Tomáš Chvátal diff --git a/krb5.spec b/krb5.spec index 6aeb52b..f0c62ef 100644 --- a/krb5.spec +++ b/krb5.spec @@ -42,6 +42,7 @@ Patch5: 0005-krb5-1.6.3-ktutil-manpage.patch Patch6: 0006-krb5-1.12-api.patch Patch7: 0007-SELinux-integration.patch Patch8: 0008-krb5-1.9-debuginfo.patch +Patch9: 0009-Fix-null-dereference-qualifying-short-hostnames.patch BuildRequires: autoconf BuildRequires: bison BuildRequires: keyutils @@ -154,14 +155,7 @@ Include Files for Development %prep %setup -q -n %{srcRoot} %setup -q -a 3 -T -D -n %{srcRoot} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 +%autopatch -p1 %build # needs to be re-generated