From 921e332134620b5b34e3a182fde1dd8d2c15153a Mon Sep 17 00:00:00 2001
From: "Alfred M. Szmidt" <ams@gnu.org>
Date: Mon, 10 Jul 2017 20:08:00 +0000
Subject: [PATCH 25/60] src/hostname.c (set_name): Handle case when
 hostname_new is NULL.

---
 ChangeLog      | 5 +++++
 src/hostname.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 72fa48bf..289a6e9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-10  Omer Anson <oaanson@gmail.com>  (tiny change)
+
+	* src/hostname.c (set_name): Handle case when hostname_new is
+	NULL.
+
 2017-07-10  Omer Anson <oaanson@gmail.com>  (tiny change)
 
 	* ftpd/ftpd.c (options) <max-timeout>: Mention mandatory argument.
diff --git a/src/hostname.c b/src/hostname.c
index 6837fd5a..d1f584f8 100644
--- a/src/hostname.c
+++ b/src/hostname.c
@@ -232,7 +232,7 @@ set_name (const hostname_arguments *const args)
   else
     hostname_new = args->hostname_new;
 
-  size = strlen (hostname_new);
+  size = hostname_new ? strlen (hostname_new) : 0;
   if (!size)
     error (EXIT_FAILURE, 0, "Empty hostname");
 
-- 
2.26.0.292.g33ef6b2f38

