[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pabbrev 6e3c38e 1/2: Safe access of subsequence.

From: Phillip Lord
Subject: [elpa] externals/pabbrev 6e3c38e 1/2: Safe access of subsequence.
Date: Thu, 06 Aug 2015 11:46:50 +0000

branch: externals/pabbrev
commit 6e3c38e3e1d27ffc45568173e21869d58615038f
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>

    Safe access of subsequence.
    Emacs 25 crashes when the indexes for cl-subseq are out-of-bounds, while
    previous Emacs silently ignored. Better to handle this here.
 pabbrev.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pabbrev.el b/pabbrev.el
index 0b1a2d2..5b8056b 100644
--- a/pabbrev.el
+++ b/pabbrev.el
@@ -1193,7 +1193,9 @@ It crashes under the same circumstances. Yeech."
       (subseq sequence from
               (min to
                    (length sequence)))
-    (cl-subseq sequence from to)))
+    (cl-subseq sequence
+               (min 0 from)
+               (min (length sequence) to))))
 (defvar pabbrev-select-mode-map
   (let ((map (make-sparse-keymap)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]