Blame SOURCES/autofs-5.1.5-add-NULL-check-for-get_addr_string-return.patch

304803
autofs-5.1.5 - add NULL check for get_addr_string() return
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
When constructing the mount location string in mount_nfs.c:mount_mount()
304803
the return from get_addr_string() is not checked for NULL.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG           |    1 +
304803
 modules/mount_nfs.c |    6 ++++++
304803
 2 files changed, 7 insertions(+)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -317,6 +317,7 @@
304803
 - move close stdio descriptors to become_daemon().
304803
 - add systemd service command line option.
304803
 - support strictexpire mount option.
304803
+- add NULL check for get_addr_string() return.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/mount_nfs.c
304803
+++ autofs-5.0.7/modules/mount_nfs.c
304803
@@ -324,7 +324,13 @@ dont_probe:
304803
 			socklen_t len = INET6_ADDRSTRLEN;
304803
 			char n_buf[len + 1];
304803
 			const char *n_addr;
304803
+
304803
 			n_addr = get_addr_string(this->addr, n_buf, len);
304803
+			if (!n_addr) {
304803
+				char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
304803
+				error(ap->logopt, "get_addr_string: %s", estr);
304803
+				goto forced_fail;
304803
+			}
304803
 			loc = malloc(strlen(n_addr) + strlen(this->path) + 4);
304803
 			if (!loc) {
304803
 				char *estr = strerror_r(errno, buf, MAX_ERR_BUF);