See: http://debbugs.gnu.org/10850
+2012-02-20 Leo Liu <sdl.web@gmail.com>
+
+ * icomplete.el (icomplete-completions): Check FROM arg before
+ passing to substring (Bug#10850).
+
2012-02-19 Chong Yidong <cyd@gnu.org>
* comint.el: Require ansi-color.
(setq prospects nil)
(while (and comps (not limit))
(setq comp
- (if prefix-len (substring (car comps) prefix-len) (car comps))
+ (if (and prefix-len (<= prefix-len (length (car comps))))
+ (substring (car comps) prefix-len)
+ (car comps))
comps (cdr comps))
(cond ((string-equal comp "") (setq most-is-exact t))
((member comp prospects))