about summary refs log tree commit diff
path: root/support/support_chroot.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-01-31 18:49:58 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-01-31 18:49:58 +0100
commit2bac7daa58da1a313bd452369b0508b31e146637 (patch)
treecb26cc3d34519adb5110c443400ff47b3c3cc00b /support/support_chroot.c
parentde44ab67aa4eec369deea828733567c35a0611c0 (diff)
downloadglibc-2bac7daa58da1a313bd452369b0508b31e146637.tar.gz
glibc-2bac7daa58da1a313bd452369b0508b31e146637.tar.xz
glibc-2bac7daa58da1a313bd452369b0508b31e146637.zip
nss_files: Fix /etc/aliases null pointer dereference [BZ #24059]
If /etc/aliases ends with a continuation line (a line that starts
with whitespace) which does not have a trailing newline character,
the file parser would crash due to a null pointer dereference.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'support/support_chroot.c')
-rw-r--r--support/support_chroot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/support/support_chroot.c b/support/support_chroot.c
index b866b89a18..412ec33f53 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -56,6 +56,7 @@ support_chroot_create (struct support_chroot_configuration conf)
               &chroot->path_resolv_conf);
   write_file (path_etc, "hosts", conf.hosts, &chroot->path_hosts);
   write_file (path_etc, "host.conf", conf.host_conf, &chroot->path_host_conf);
+  write_file (path_etc, "aliases", conf.aliases, &chroot->path_aliases);
 
   free (path_etc);
 
@@ -77,5 +78,6 @@ support_chroot_free (struct support_chroot *chroot)
   free (chroot->path_resolv_conf);
   free (chroot->path_hosts);
   free (chroot->path_host_conf);
+  free (chroot->path_aliases);
   free (chroot);
 }