Menu

#254 MIME tag presence detection can fail

Unassigned
open
nobody
None
5
2018-09-23
2010-05-21
No

Hi all,

We currently check if MIME attachments constructs (with part
declarations) are present using:

(defun mh-mml-tag-present-p ()
"Check if the current buffer has text which may be a MML tag."
(save-excursion
(goto-char (point-min))
(re-search-forward
(concat
"\\(<#\\(mml\|part\\)\\(.\|\n\\)*>[ \n\t]*<#/\\(mml\|part\\)>\|"
"^<#secure.+>$\\)")
nil t)))

But in the content of the attachment may not be in a file, but in the
buffer itself. In such cases, the above may fail when ther is too much text:

Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")

I suggest that looking for the closing part isn't required and this
should be okay:

(defun mh-mml-tag-present-p ()
"Check if the current buffer has text which may be a MML tag."
(save-excursion
(goto-char (point-min))
(re-search-forward "\\(<#\\(mml\|part\\)\|^<#secure.+>$\\)" nil t)))

Discussion

  • Bill Wohler

    Bill Wohler - 2013-02-23
    • Status: open --> unread
     
  • Bill Wohler

    Bill Wohler - 2016-01-18
    • status: unread --> open
    • Milestone: --> Unassigned
     
  • Bill Wohler

    Bill Wohler - 2018-09-23

    See #479, which may be a duplicate and contains a test message.

     

Log in to post a comment.

MongoDB Logo MongoDB