diff options
| author | Dmitry Antipov | 2014-06-25 14:36:51 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-06-25 14:36:51 +0400 |
| commit | 5697ca55cb79817a6704c344cc76d866ee2e1699 (patch) | |
| tree | 3d9cace5c0dd430485eb16697cb6c045553eb3ae /lisp/info.el | |
| parent | 9a214b9800b7c01d8a473a2564e8f57215990b24 (diff) | |
| download | emacs-5697ca55cb79817a6704c344cc76d866ee2e1699.tar.gz emacs-5697ca55cb79817a6704c344cc76d866ee2e1699.zip | |
Do not allow out-of-range character position in Fcompare_strings.
* src/fns.c (validate_subarray): Add prototype.
(Fcompare_substring): Use validate_subarray to check ranges.
Adjust comment to mention that the semantics was changed. Also see
http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00447.html.
* lisp/files.el (dir-locals-find-file, file-relative-name):
* lisp/info.el (Info-complete-menu-item):
* lisp/minibuffer.el (completion-table-subvert): Prefer string-prefix-p
to compare-strings to avoid out-of-range errors.
* lisp/subr.el (string-prefix-p): Adjust to match strict range
checking in compare-strings.
* test/automated/fns-tests.el (fns-tests-compare-string): New test.
Diffstat (limited to 'lisp/info.el')
| -rw-r--r-- | lisp/info.el | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/info.el b/lisp/info.el index 89ca8bdbe33..405d6a22449 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2691,9 +2691,7 @@ Because of ambiguities, this should be concatenated with something like | |||
| 2691 | (equal (nth 1 Info-complete-cache) Info-current-node) | 2691 | (equal (nth 1 Info-complete-cache) Info-current-node) |
| 2692 | (equal (nth 2 Info-complete-cache) Info-complete-next-re) | 2692 | (equal (nth 2 Info-complete-cache) Info-complete-next-re) |
| 2693 | (equal (nth 5 Info-complete-cache) Info-complete-nodes) | 2693 | (equal (nth 5 Info-complete-cache) Info-complete-nodes) |
| 2694 | (let ((prev (nth 3 Info-complete-cache))) | 2694 | (string-prefix-p (nth 3 Info-complete-cache) string) t) |
| 2695 | (eq t (compare-strings string 0 (length prev) | ||
| 2696 | prev 0 nil t)))) | ||
| 2697 | ;; We can reuse the previous list. | 2695 | ;; We can reuse the previous list. |
| 2698 | (setq completions (nth 4 Info-complete-cache)) | 2696 | (setq completions (nth 4 Info-complete-cache)) |
| 2699 | ;; The cache can't be used. | 2697 | ;; The cache can't be used. |