aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-08-31 13:02:51 -0700
committerPaul Eggert2011-08-31 13:02:51 -0700
commite91caa6011949f45790cd131883b2b3b26d6a0a2 (patch)
tree2a45db55036fca909bb43d0a5bfdbfe777f8e9e8 /src
parent61bfeeb79dee6b321cb9f2257aeec9d0c1fa5a2f (diff)
parent9b6e5515b40f5863df5533fd90428799b62eac43 (diff)
downloademacs-e91caa6011949f45790cd131883b2b3b26d6a0a2.tar.gz
emacs-e91caa6011949f45790cd131883b2b3b26d6a0a2.zip
Merge from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/syntax.c5
2 files changed, 14 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d0f57593220..463f2965baa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,15 +1,5 @@
12011-08-31 Paul Eggert <eggert@cs.ucla.edu> 12011-08-31 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Avoid the use of snprintf.
4 * font.c (APPEND_SNPRINTF): Remove.
5 (font_unparse_xlfd):
6 * xterm.c (x_io_error_quitter):
7 Use esnprintf, not snprintf. That way, we don't have to worry
8 about porting to ancient platforms that lack snprintf.
9 (x_term_init): Use sprintf, not snprintf.
10
112011-08-30 Paul Eggert <eggert@cs.ucla.edu>
12
13 sprintf-related integer and memory overflow issues (Bug#9412). 3 sprintf-related integer and memory overflow issues (Bug#9412).
14 4
15 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values. 5 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
@@ -53,10 +43,9 @@
53 * font.c: Include <float.h>, for DBL_MAX_10_EXP. 43 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
54 (font_unparse_xlfd): Don't blindly alloca long strings. 44 (font_unparse_xlfd): Don't blindly alloca long strings.
55 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10 45 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
56 fits in int, when using sprintf. Use single snprintf to count 46 fits in int, when using sprintf. Use single esnprintf to count
57 length of string rather than counting it via multiple sprintfs; 47 length of string rather than counting it via multiple sprintfs;
58 that's simpler and more reliable. 48 that's simpler and more reliable.
59 (APPEND_SPRINTF): New macro.
60 (font_unparse_fcname): Use it to avoid sprintf buffer overrun. 49 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
61 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not 50 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
62 sprintf, in case result does not fit in int. 51 sprintf, in case result does not fit in int.
@@ -111,9 +100,17 @@
111 to avoid potential buffer overrun. 100 to avoid potential buffer overrun.
112 101
113 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. 102 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
103 (x_term_init): Use sprintf, not snprintf, so that we need not
104 worry about ancient hosts that lack snprintf. The buffer cannot
105 possibly be overrun, so this is safe.
114 106
115 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF. 107 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
116 108
1092011-08-30 Chong Yidong <cyd@stupidchicken.com>
110
111 * syntax.c (find_defun_start): Update all cache variables if
112 exiting early (Bug#9401).
113
1172011-08-30 Eli Zaretskii <eliz@gnu.org> 1142011-08-30 Eli Zaretskii <eliz@gnu.org>
118 115
119 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings. 116 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
diff --git a/src/syntax.c b/src/syntax.c
index 8c2d5ded21f..3e51099794b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -398,7 +398,12 @@ find_defun_start (EMACS_INT pos, EMACS_INT pos_byte)
398 398
399 if (!open_paren_in_column_0_is_defun_start) 399 if (!open_paren_in_column_0_is_defun_start)
400 { 400 {
401 find_start_value = BEGV;
401 find_start_value_byte = BEGV_BYTE; 402 find_start_value_byte = BEGV_BYTE;
403 find_start_buffer = current_buffer;
404 find_start_modiff = MODIFF;
405 find_start_begv = BEGV;
406 find_start_pos = pos;
402 return BEGV; 407 return BEGV;
403 } 408 }
404 409