This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".
The branch, master has been updated
via 91960071d72dcb4bfb5182b96ebe81694cfce3e1 (commit)
via 55084756318a749156ae7819f886a796ba05b025 (commit)
from 7f221ff1f910f963c1367f21b25e36137995cd5c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=91960071d72dcb4bfb5182b96ebe81694cfce3e1
commit 91960071d72dcb4bfb5182b96ebe81694cfce3e1
Author: Alfred M. Szmidt <[email protected]>
Date: Mon Jul 10 20:14:58 2017 +0000
src/hostname.c (parse_file): Free name and allocate one extra byte for it.
diff --git a/ChangeLog b/ChangeLog
index fdd1fcd..ea93a84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2017-07-10 Omer Anson <[email protected]> (tiny change)
+ * src/hostname.c (parse_file): Free name and allocate one extra
+ byte for it.
+
+2017-07-10 Omer Anson <[email protected]> (tiny change)
+
* src/hostname.c (set_name): Handle case when hostname_new is
NULL.
diff --git a/src/hostname.c b/src/hostname.c
index 95bf108..f53bb20 100644
--- a/src/hostname.c
+++ b/src/hostname.c
@@ -410,9 +410,11 @@ parse_file (const char *const file_name)
if (buffer[0] != '#')
{
- name = (char *) xmalloc (sizeof (char) * nread);
- if (sscanf (buffer, "%s", name) == 1)
+ name = (char *) xmalloc (sizeof (char) * (nread + 1));
+ if (sscanf (buffer, "%s", name) == 1)
break;
+ free (name);
+ name = NULL;
}
}
while (feof (file) == 0);
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=55084756318a749156ae7819f886a796ba05b025
commit 55084756318a749156ae7819f886a796ba05b025
Author: Alfred M. Szmidt <[email protected]>
Date: Mon Jul 10 20:08:00 2017 +0000
src/hostname.c (set_name): Handle case when hostname_new is NULL.
diff --git a/ChangeLog b/ChangeLog
index ee9ebef..fdd1fcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2017-07-10 Omer Anson <[email protected]> (tiny change)
+ * src/hostname.c (set_name): Handle case when hostname_new is
+ NULL.
+
+2017-07-10 Omer Anson <[email protected]> (tiny change)
+
* ftpd/ftpd.c (options) <max-timeout>: Mention mandatory argument.
2017-06-22 Omer Anson <[email protected]> (tiny change)
diff --git a/src/hostname.c b/src/hostname.c
index 7178cc4..95bf108 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");
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 10 ++++++++++
src/hostname.c | 8 +++++---
2 files changed, 15 insertions(+), 3 deletions(-)
hooks/post-receive
--
GNU Inetutils
_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils