aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-30 16:35:42 +0000
committerGerd Moellmann2001-10-30 16:35:42 +0000
commitb4a3be43850ed770a06b94d96c77b27346b828b9 (patch)
treeb03857d98fed180f2ebc9b759e7990f44985bdce /src
parent8d7b140f13799b9b745166d6bddd9054f3f9ae8f (diff)
downloademacs-b4a3be43850ed770a06b94d96c77b27346b828b9.tar.gz
emacs-b4a3be43850ed770a06b94d96c77b27346b828b9.zip
(to_multibyte): Ensure read_buffer is at least twice
as large as the number of bytes to convert.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/lread.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0eb9c31220d..db1539af6f2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12001-10-30 Gerd Moellmann <gerd@gnu.org> 12001-10-30 Gerd Moellmann <gerd@gnu.org>
2 2
3 * lread.c (to_multibyte): Ensure read_buffer is at least twice
4 as large as the number of bytes to convert.
5
3 * lread.c (to_multibyte): New function. 6 * lread.c (to_multibyte): New function.
4 (read1): Use it. 7 (read1): Use it.
5 8
diff --git a/src/lread.c b/src/lread.c
index 59e84105a39..072de3a98ec 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1790,7 +1790,7 @@ to_multibyte (p, end, nchars)
1790 int nbytes; 1790 int nbytes;
1791 1791
1792 parse_str_as_multibyte (read_buffer, *p - read_buffer, &nbytes, nchars); 1792 parse_str_as_multibyte (read_buffer, *p - read_buffer, &nbytes, nchars);
1793 if (nbytes > read_buffer_size) 1793 if (read_buffer_size < 2 * nbytes)
1794 { 1794 {
1795 int offset = *p - read_buffer; 1795 int offset = *p - read_buffer;
1796 read_buffer_size *= 2; 1796 read_buffer_size *= 2;
@@ -2239,6 +2239,9 @@ read1 (readcharfun, pch, first_in_list)
2239 if (c < 0) 2239 if (c < 0)
2240 end_of_file_error (); 2240 end_of_file_error ();
2241 2241
2242 if (p - read_buffer == 24183)
2243 fprintf (stderr, "hello\n");
2244
2242 /* If purifying, and string starts with \ newline, 2245 /* If purifying, and string starts with \ newline,
2243 return zero instead. This is for doc strings 2246 return zero instead. This is for doc strings
2244 that we are really going to find in etc/DOC.nn.nn */ 2247 that we are really going to find in etc/DOC.nn.nn */