Index: lisp/rfc2231.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/rfc2231.el,v retrieving revision 7.25 diff -u -r7.25 rfc2231.el --- lisp/rfc2231.el 24 Apr 2008 04:19:20 -0000 7.25 +++ lisp/rfc2231.el 5 May 2008 20:13:34 -0000 @@ -217,10 +217,11 @@ (insert value) (goto-char (point-min)) (while (search-forward "%" nil t) - (insert - (prog1 - (string-to-number (buffer-substring (point) (+ (point) 2)) 16) - (delete-region (1- (point)) (+ (point) 2))))) + (if (<= (+ (point) 2) (point-max)) + (insert + (prog1 + (string-to-number (buffer-substring (point) (+ (point) 2)) 16) + (delete-region (1- (point)) (+ (point) 2)))))) ;; Decode using the charset, if any. (if (memq coding-system '(nil ascii)) (buffer-string)