2013-04-13 13:09:53 +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-05-29 17:26:40 +02:00
|
|
|
src/nss-myhostname/nss-myhostname.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
2013-04-13 13:09:53 +02:00
|
|
|
|
2013-07-23 11:21:21 +02:00
|
|
|
--- systemd-206.orig/src/nss-myhostname/nss-myhostname.c
|
|
|
|
+++ systemd-206/src/nss-myhostname/nss-myhostname.c
|
|
|
|
@@ -442,6 +442,12 @@ enum nss_status _nss_myhostname_gethostb
|
2013-05-29 17:26:40 +02:00
|
|
|
uint32_t local_address_ipv4 = LOCALADDRESS_IPV4;
|
|
|
|
const char *canonical = NULL, *additional = NULL;
|
2013-04-13 13:09:53 +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;
|