diff options
| author | Karl Heuer | 1994-03-17 23:29:16 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-03-17 23:29:16 +0000 |
| commit | 5458f7f15818ccc49685ec9ac4e0195d77bb3fcf (patch) | |
| tree | b8e755971de3e2c0cb6aac3ebeff2882b50771ab | |
| parent | b9fdbd74d730703bc50c6a5f86fa0c4469fd375c (diff) | |
| download | emacs-5458f7f15818ccc49685ec9ac4e0195d77bb3fcf.tar.gz emacs-5458f7f15818ccc49685ec9ac4e0195d77bb3fcf.zip | |
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
| -rw-r--r-- | lisp/mail/rmail.el | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 40ab9117264..057ae8f9804 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -928,9 +928,26 @@ argument causes us to read a file name and use that file as the inbox." | |||
| 928 | header-end t) | 928 | header-end t) |
| 929 | (let ((beg (point)) | 929 | (let ((beg (point)) |
| 930 | (eol (progn (end-of-line) (point)))) | 930 | (eol (progn (end-of-line) (point)))) |
| 931 | (read (buffer-substring beg eol))))))) | 931 | (string-to-int (buffer-substring beg eol))))))) |
| 932 | (and size (numberp size) (>= size 0) | 932 | (and size |
| 933 | (goto-char (+ header-end size)))) | 933 | (if (and (natnump size) |
| 934 | (<= (+ header-end size) (point-max)) | ||
| 935 | ;; Make sure this would put us at a position | ||
| 936 | ;; that we could continue from. | ||
| 937 | (save-excursion | ||
| 938 | (goto-char (+ header-end size)) | ||
| 939 | (skip-chars-forward "\n") | ||
| 940 | (or (eobp) | ||
| 941 | (and (looking-at "BABYL OPTIONS:") | ||
| 942 | (search-forward "\n\^_" nil t)) | ||
| 943 | (and (looking-at "\^L") | ||
| 944 | (search-forward "\n\^_" nil t)) | ||
| 945 | (let ((case-fold-search t)) | ||
| 946 | (looking-at mmdf-delim1)) | ||
| 947 | (looking-at "From ")))) | ||
| 948 | (goto-char (+ header-end size)) | ||
| 949 | (message "Ignoring invalid Content-Length field") | ||
| 950 | (sit-for 1 0 t)))) | ||
| 934 | 951 | ||
| 935 | (if (re-search-forward | 952 | (if (re-search-forward |
| 936 | (concat "^[\^_]?\\(" | 953 | (concat "^[\^_]?\\(" |