summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2012-02-08 18:54:31 +0000
committerwl <wl>2012-02-08 18:54:31 +0000
commit7da6b086fa455781c8de86477fe24f2ccc21609f (patch)
tree8f7b7c84cf1c36c982909eaf0d6da91ba812a7ac /src
parent0abbddad25126ac84dd18560bfd9b89f12b71611 (diff)
downloadgroff-7da6b086fa455781c8de86477fe24f2ccc21609f.tar.gz
* src/preproc/pic/main.cpp (do_file): Check for invalid characters.
Problem reported by Doug McIlroy <doug@cs.dartmouth.edu>.
Diffstat (limited to 'src')
-rw-r--r--src/preproc/pic/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 3b974165..f242da0b 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003, 2006, 2009
+/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003, 2006, 2009, 2012
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -316,6 +316,10 @@ void do_file(const char *filename)
enum { START, MIDDLE, HAD_DOT, HAD_P, HAD_PS, HAD_l, HAD_lf } state = START;
for (;;) {
int c = getc(fp);
+ while (invalid_input_char(c)) {
+ error("invalid input character code %1", int(c));
+ c = getc(fp);
+ }
if (c == EOF)
break;
switch (state) {