mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user