aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-03-27 16:16:36 +0300
committerEli Zaretskii2015-03-27 16:16:36 +0300
commit9552a65f3187ad13f22392e17e3faf25defd259e (patch)
tree41ea3daa36ff76ad2401a45268a844f4eb2337be /src
parent5ba79b03f3ca5f0d9fab833e78517faeb06c4c5f (diff)
downloademacs-9552a65f3187ad13f22392e17e3faf25defd259e.tar.gz
emacs-9552a65f3187ad13f22392e17e3faf25defd259e.zip
Fix crashes when restoring sub-char-tables from desktop file
src/lread.c (substitute_object_recurse): For sub-char-tables, start the recursive SUBSTITUTE loop from index of 2, to skip the non-Lisp members of the sub-char-table. See the discussion at http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00520.html for the details.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/lread.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c003e4454db..98037e851a4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12015-03-27 Eli Zaretskii <eliz@gnu.org> 12015-03-27 Eli Zaretskii <eliz@gnu.org>
2 2
3 * lread.c (substitute_object_recurse): For sub-char-tables, start
4 the recursive SUBSTITUTE loop from index of 2, to skip the
5 non-Lisp members of the sub-char-table. See the discussion at
6 http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00520.html
7 for the details.
8
3 Support non-blocking connect on MS-Windows. 9 Support non-blocking connect on MS-Windows.
4 Based on ideas from Kim F. Storm <storm@cua.dk>, see 10 Based on ideas from Kim F. Storm <storm@cua.dk>, see
5 http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html. 11 http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html.
diff --git a/src/lread.c b/src/lread.c
index ae175296ddb..050e43e2d08 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3280,7 +3280,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
3280 { 3280 {
3281 case Lisp_Vectorlike: 3281 case Lisp_Vectorlike:
3282 { 3282 {
3283 ptrdiff_t i, length = 0; 3283 ptrdiff_t i = 0, length = 0;
3284 if (BOOL_VECTOR_P (subtree)) 3284 if (BOOL_VECTOR_P (subtree))
3285 return subtree; /* No sub-objects anyway. */ 3285 return subtree; /* No sub-objects anyway. */
3286 else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree) 3286 else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree)
@@ -3295,7 +3295,9 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
3295 behavior. */ 3295 behavior. */
3296 wrong_type_argument (Qsequencep, subtree); 3296 wrong_type_argument (Qsequencep, subtree);
3297 3297
3298 for (i = 0; i < length; i++) 3298 if (SUB_CHAR_TABLE_P (subtree))
3299 i = 2;
3300 for ( ; i < length; i++)
3299 SUBSTITUTE (AREF (subtree, i), 3301 SUBSTITUTE (AREF (subtree, i),
3300 ASET (subtree, i, true_value)); 3302 ASET (subtree, i, true_value));
3301 return subtree; 3303 return subtree;