# HG changeset patch # User Karl Heuer # Date 763946956 0 # Node ID 9b45e828c2a79fa243a32b277ea9e302cb394fcd # Parent c82a7e9ae93b220a20b6420dcdff065736f5512e (rmail-convert-to-babyl-format): Check Content-Length field for consistency. diff -r c82a7e9ae93b -r 9b45e828c2a7 lisp/mail/rmail.el --- a/lisp/mail/rmail.el Thu Mar 17 22:38:14 1994 +0000 +++ b/lisp/mail/rmail.el Thu Mar 17 23:29:16 1994 +0000 @@ -928,9 +928,26 @@ header-end t) (let ((beg (point)) (eol (progn (end-of-line) (point)))) - (read (buffer-substring beg eol))))))) - (and size (numberp size) (>= size 0) - (goto-char (+ header-end size)))) + (string-to-int (buffer-substring beg eol))))))) + (and size + (if (and (natnump size) + (<= (+ header-end size) (point-max)) + ;; Make sure this would put us at a position + ;; that we could continue from. + (save-excursion + (goto-char (+ header-end size)) + (skip-chars-forward "\n") + (or (eobp) + (and (looking-at "BABYL OPTIONS:") + (search-forward "\n\^_" nil t)) + (and (looking-at "\^L") + (search-forward "\n\^_" nil t)) + (let ((case-fold-search t)) + (looking-at mmdf-delim1)) + (looking-at "From ")))) + (goto-char (+ header-end size)) + (message "Ignoring invalid Content-Length field") + (sit-for 1 0 t)))) (if (re-search-forward (concat "^[\^_]?\\("