summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/line.c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-19 17:04:02 +0000
committerKarl Berry <karl@freefriends.org>2020-01-19 17:04:02 +0000
commiteeb7eab0a55e0bb85518b0fed6776c40cca8df80 (patch)
tree44b689f7d705d0d8ddbd16f6339d7c841d9d25e8 /Build/source/texk/kpathsea/line.c
parent8a8104081ac2b2038544981a21b6e6dd69602ebb (diff)
drop NUL (zero) bytes in texmf.cnf and other files read by kpse
git-svn-id: svn://tug.org/texlive/trunk@53454 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/line.c')
-rw-r--r--Build/source/texk/kpathsea/line.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Build/source/texk/kpathsea/line.c b/Build/source/texk/kpathsea/line.c
index 6c66a302b7f..7d677a5599a 100644
--- a/Build/source/texk/kpathsea/line.c
+++ b/Build/source/texk/kpathsea/line.c
@@ -1,6 +1,6 @@
/* line.c: return the next line from a file, or NULL.
- Copyright 1992, 1993, 1995, 1996, 2008, 2013, 2014 Karl Berry.
+ Copyright 1992, 1993, 1995, 1996, 2008, 2013, 2014, 2020 Karl Berry.
Copyright 1998, 1999, 2001, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -55,6 +55,11 @@ read_line (FILE *f)
FLOCKFILE (f);
while ((c = getc (f)) != EOF && c != '\n' && c != '\r') {
+ /* Silently drop null bytes. */
+ if (c == 0) {
+ continue;
+ }
+
line[loc] = c;
loc++;