summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-03-22 21:59:02 +0000
committerKarl Heuer <kwzh@gnu.org>1994-03-22 21:59:02 +0000
commitf943104adbd9be9e67f2ae17dcd0c4143f075acd (patch)
treedfa9bde8d2846f41cfd5c07a0f675b5d369fd77d /src/lread.c
parent18e3ab4119a7d674e60261e44f03faee117cf596 (diff)
downloademacs-f943104adbd9be9e67f2ae17dcd0c4143f075acd.tar.gz
(read1): Check for invalid modifier bits in a string.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lread.c b/src/lread.c
index ccb2f52d238..af7a0153b02 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1210,11 +1210,15 @@ read1 (readcharfun)
if (p == read_buffer)
cancel = 1;
}
- else if (c & CHAR_META)
- /* Move the meta bit to the right place for a string. */
- *p++ = (c & ~CHAR_META) | 0x80;
else
- *p++ = c;
+ {
+ if (c & CHAR_META)
+ /* Move the meta bit to the right place for a string. */
+ c = (c & ~CHAR_META) | 0x80;
+ if (c & ~0xff)
+ error ("Invalid modifier in string");
+ *p++ = c;
+ }
}
if (c < 0) return Fsignal (Qend_of_file, Qnil);