recipes: networking/ineutils: Apply patches from Debian in order to refresh this...
[dragora.git] / patches / inetutils / 0025-src-hostname.c-set_name-Handle-case-when-hostname_ne.patch
blob221bdb1cd7ed89994c02b74415440ea6921078d5
1 From 921e332134620b5b34e3a182fde1dd8d2c15153a Mon Sep 17 00:00:00 2001
2 From: "Alfred M. Szmidt" <ams@gnu.org>
3 Date: Mon, 10 Jul 2017 20:08:00 +0000
4 Subject: [PATCH 25/60] src/hostname.c (set_name): Handle case when
5 hostname_new is NULL.
7 ---
8 ChangeLog | 5 +++++
9 src/hostname.c | 2 +-
10 2 files changed, 6 insertions(+), 1 deletion(-)
12 diff --git a/ChangeLog b/ChangeLog
13 index 72fa48bf..289a6e9f 100644
14 --- a/ChangeLog
15 +++ b/ChangeLog
16 @@ -1,3 +1,8 @@
17 +2017-07-10 Omer Anson <oaanson@gmail.com> (tiny change)
19 + * src/hostname.c (set_name): Handle case when hostname_new is
20 + NULL.
22 2017-07-10 Omer Anson <oaanson@gmail.com> (tiny change)
24 * ftpd/ftpd.c (options) <max-timeout>: Mention mandatory argument.
25 diff --git a/src/hostname.c b/src/hostname.c
26 index 6837fd5a..d1f584f8 100644
27 --- a/src/hostname.c
28 +++ b/src/hostname.c
29 @@ -232,7 +232,7 @@ set_name (const hostname_arguments *const args)
30 else
31 hostname_new = args->hostname_new;
33 - size = strlen (hostname_new);
34 + size = hostname_new ? strlen (hostname_new) : 0;
35 if (!size)
36 error (EXIT_FAILURE, 0, "Empty hostname");
38 --
39 2.26.0.292.g33ef6b2f38