2013-04-23 11:39:56 +02:00
|
|
|
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
|
|
Date: Mon, 26 Nov 2012 09:49:42 +0100
|
|
|
|
Subject: avoid assertion if invalid address familily is passed to
|
|
|
|
gethostbyaddr_r (bnc#791101)
|
|
|
|
|
|
|
|
---
|
2013-06-05 13:16:22 +02:00
|
|
|
src/nss-myhostname/nss-myhostname.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
2013-04-23 11:39:56 +02:00
|
|
|
|
|
|
|
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
|
2013-06-05 13:16:22 +02:00
|
|
|
index 60e256d..e97d4e5 100644
|
2013-04-23 11:39:56 +02:00
|
|
|
--- a/src/nss-myhostname/nss-myhostname.c
|
|
|
|
+++ b/src/nss-myhostname/nss-myhostname.c
|
2013-06-05 13:16:22 +02:00
|
|
|
@@ -442,6 +442,12 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r(
|
|
|
|
uint32_t local_address_ipv4 = LOCALADDRESS_IPV4;
|
|
|
|
const char *canonical = NULL, *additional = NULL;
|
2013-04-23 11:39:56 +02:00
|
|
|
|
|
|
|
+ if (af != AF_INET && af != AF_INET6) {
|
|
|
|
+ *errnop = EAFNOSUPPORT;
|
|
|
|
+ *h_errnop = NO_DATA;
|
|
|
|
+ return NSS_STATUS_UNAVAIL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (len != PROTO_ADDRESS_SIZE(af)) {
|
|
|
|
*errnop = EINVAL;
|
|
|
|
*h_errnop = NO_RECOVERY;
|