regional_alloc() failure handled

Resolves: rhbz#1977401
This commit is contained in:
Artem Egorenkov 2022-02-10 13:46:19 +01:00
parent 0cf2f91dfc
commit 8f06fba292
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff --git a/dns64/dns64.c b/dns64/dns64.c
index c79bc9c..fc7827e 100644
--- a/dns64/dns64.c
+++ b/dns64/dns64.c
@@ -687,6 +687,12 @@ dns64_operate(struct module_qstate* qstate, enum module_ev event, int id,
/* Tag this query as being new and fall through. */
iq = (struct dns64_qstate*)regional_alloc(
qstate->region, sizeof(*iq));
+ if (!(iq = (struct dns64_qstate*)regional_alloc(
+ qstate->region, sizeof(*iq)))) {
+ log_err("out of memory");
+ qstate->ext_state[id] = module_error;
+ return;
+ }
qstate->minfo[id] = iq;
iq->state = DNS64_NEW_QUERY;
iq->started_no_cache_store = qstate->no_cache_store;

View File

@ -37,7 +37,7 @@
Summary: Validating, recursive, and caching DNS(SEC) resolver
Name: unbound
Version: 1.13.1
Release: 10%{?extra_version:.%{extra_version}}%{?dist}
Release: 11%{?extra_version:.%{extra_version}}%{?dist}
License: BSD
Url: https://nlnetlabs.nl/projects/unbound/
Source: https://nlnetlabs.nl/downloads/%{name}/%{name}-%{version}%{?extra_version}.tar.gz
@ -64,6 +64,7 @@ Source19: http://keys.gnupg.net/pks/lookup?op=get&search=0x9F6F1C2D7E045F8D#/wou
Patch1: unbound-1.13.1-rh1952814.patch
Patch2: unbound-1.13.1-rh1991005.patch
Patch3: unbound-1.13.1-rh1977400.patch
Patch4: unbound-1.13.1-rh1977401.patch
BuildRequires: gcc, make
BuildRequires: flex, openssl-devel
@ -462,6 +463,10 @@ popd
%attr(0644,root,root) %config %{_sysconfdir}/%{name}/root.key
%changelog
* Thu Feb 10 2022 Artem Egorenkov <aegorenk@redhat.com> - 1.13.1-11
- regional_alloc() failure handled
- Resolves: rhbz#1977401
* Thu Feb 10 2022 Artem Egorenkov <aegorenk@redhat.com> - 1.13.1-10
- RESOURCE_LEAK fixed
- Resolves: rhbz#1977400