[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/03: patches/hurd-i386/git-gethostname.diff: New patch



This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch glibc-2.26
in repository glibc.

commit 842da61ba3bfe59816670315a193ff6ab5d23d7b
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Wed Sep 6 22:55:00 2017 +0000

    patches/hurd-i386/git-gethostname.diff: New patch
---
 debian/changelog                              |  1 +
 debian/patches/hurd-i386/git-gethostname.diff | 32 +++++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 34 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e67b33d..9d7fe38 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -62,6 +62,7 @@ glibc (2.26-0experimental0~ppa4) UNRELEASED; urgency=medium
     - patches/hurd-i386/git-x86-tunables.diff: New patch.
     - patches/hurd-i386/git-rtld-strtoul_internal.diff: New patch.
     - patches/hurd-i386/git-clone.diff: New patch.
+    - patches/hurd-i386/git-gethostname.diff: New patch.
     - testsuite-xfail-debian.mk: Update with new tests failing on hurd-i386.
 
  -- Adam Conrad <adconrad@0c3.net>  Sat, 02 Sep 2017 12:15:10 -0600
diff --git a/debian/patches/hurd-i386/git-gethostname.diff b/debian/patches/hurd-i386/git-gethostname.diff
new file mode 100644
index 0000000..e7b3b39
--- /dev/null
+++ b/debian/patches/hurd-i386/git-gethostname.diff
@@ -0,0 +1,32 @@
+commit 507fe02799e7dbaba9ebaf3264731fc3b928ba77
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Thu Sep 7 00:51:17 2017 +0200
+
+    hurd: fix gethostname(NULL, 0)
+    
+            * hurd/get-host.c (_hurd_get_host_config): Also check that more == 0
+            before assuming that the file is empty.  Avoid testing buffer content
+            when nread == 0.
+
+diff --git a/hurd/get-host.c b/hurd/get-host.c
+index be8345fbf9..e5d0539275 100644
+--- a/hurd/get-host.c
++++ b/hurd/get-host.c
+@@ -65,7 +65,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
+     }
+ 
+   /* If the file is empty, give an empty value.  */
+-  if (nread == 0)
++  if (nread == 0 && more == 0)
+     {
+       if (buflen != 0)
+ 	*buf = '\0';
+@@ -80,7 +80,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
+   if (nread < buflen)
+     buf[nread] = '\0';
+   else
+-    if (buf[nread - 1] != '\0')
++    if (nread != 0 && buf[nread - 1] != '\0')
+       more = 1;
+ 
+   if (more)
diff --git a/debian/patches/series b/debian/patches/series
index d9c9ea7..9f43ff4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -147,6 +147,7 @@ hurd-i386/git-x86-tunables.diff
 hurd-i386/git-i386-implies-x86.diff
 hurd-i386/git-rtld-strtoul_internal.diff
 hurd-i386/git-clone.diff
+hurd-i386/git-gethostname.diff
 
 i386/local-biarch.diff
 i386/unsubmitted-quiet-ldconfig.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: