Ar an tríú lá is fiche de mí Feabhra, scríobh Raymond Toy:
Here's a simple recipe to crash xemacs with the latest version
(well,
from a few days ago) from the hg repo.
xemacs -vanilla. Then M-x : (substring-no-properties nil)
Instantly crashes xemacs.
Thanks for the bug report, Raymond. This was my bug, and I’ve just committed
the below.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1298540179 0
# Node ID 46b53e84ea7a78d380ab318a8a4f4b6733ff097b
# Parent f5a5501814f5a160bfdd3e31be654e04aad3b4e0
#'substring-no-properties: check STRING's type, get_string_range_char won't.
src/ChangeLog addition:
2011-02-24 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (Fsubstring_no_properties):
Sigh, get_string_range_char checks the type of its START and END
arguments, but doesn't check the type of its STRING
argument. Thank you Raymond Toy!
tests/ChangeLog addition:
2011-02-24 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el (substring-no-properties):
Make sure this function checks its arguments' types, the absence
of which was revealed by Raymond Toy's bug report of
http://mid.gmane.org/4D65D413.5050103@gmail.com .
diff -r f5a5501814f5 -r 46b53e84ea7a src/ChangeLog
--- a/src/ChangeLog Sat Feb 19 11:03:46 2011 +0000
+++ b/src/ChangeLog Thu Feb 24 09:36:19 2011 +0000
@@ -1,3 +1,10 @@
+2011-02-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fns.c (Fsubstring_no_properties):
+ Sigh, get_string_range_char checks the type of its START and END
+ arguments, but doesn't check the type of its STRING
+ argument. Thank you Raymond Toy!
+
2011-02-19 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (Fset_exclusive_or):
diff -r f5a5501814f5 -r 46b53e84ea7a src/fns.c
--- a/src/fns.c Sat Feb 19 11:03:46 2011 +0000
+++ b/src/fns.c Thu Feb 24 09:36:19 2011 +0000
@@ -2095,6 +2095,7 @@
Bytecount bstart, blen;
Lisp_Object val;
+ CHECK_STRING (string);
get_string_range_char (string, start, end, &ccstart, &ccend,
GB_HISTORICAL_STRING_BEHAVIOR);
bstart = string_index_char_to_byte (string, ccstart);
diff -r f5a5501814f5 -r 46b53e84ea7a tests/ChangeLog
--- a/tests/ChangeLog Sat Feb 19 11:03:46 2011 +0000
+++ b/tests/ChangeLog Thu Feb 24 09:36:19 2011 +0000
@@ -1,3 +1,10 @@
+2011-02-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/lisp-tests.el (substring-no-properties):
+ Make sure this function checks its arguments' types, the absence
+ of which was revealed by Raymond Toy's bug report of
+
http://mid.gmane.org/4D65D413.5050103@gmail.com .
+
2011-02-10 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
diff -r f5a5501814f5 -r 46b53e84ea7a tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el Sat Feb 19 11:03:46 2011 +0000
+++ b/tests/automated/lisp-tests.el Thu Feb 24 09:36:19 2011 +0000
@@ -1339,6 +1339,10 @@
(Check-Error args-out-of-range (subseq [1 2 3] -42))
(Check-Error args-out-of-range (subseq [1 2 3] 0 42))
+(Check-Error wrong-type-argument (substring-no-properties nil 4))
+(Check-Error wrong-type-argument (substring-no-properties "hi there" pi))
+(Check-Error wrong-type-argument (substring-no-properties "hi there" 0))
+
;;-----------------------------------------------------
;; Time-related tests
;;-----------------------------------------------------
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta