unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: Austin Clements <amdragon@mit.edu>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: fix MML quoting in replies
Date: Thu, 15 Mar 2012 08:33:21 +0200	[thread overview]
Message-ID: <CAB+hUn8FJ-=CA1JZoYMzH0-E+S9Y75TPqgb1w6YKFuU6=S2Xqw@mail.gmail.com> (raw)
In-Reply-To: <87k42momyi.fsf@awakening.csail.mit.edu>

[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]

On Mar 15, 2012 12:08 AM, "Austin Clements" <amdragon@mit.edu> wrote:
>
> On Sun,  4 Mar 2012 10:25:38 +0200, Jani Nikula <jani@nikula.org> wrote:
> > The reply MML quoting added in commit ae438cc unintentionally MML
> > quotes also the signature/encryption MML tags added via
> > message-setup-hook, causing the reply not to be signed/encrypted.
> >
> > MML quote just the original message in the temp buffer before
> > inserting it to the message buffer, to not interfere with message mode
> > hooks or message construction in general.
> >
> > See [1] and [2] for bug reports.
> >
> > Thanks to Tim Bielawa <tbielawa@redhat.com> for testing.
> >
> > [1] id:"87hay78x6l.fsf@wyzanski.jamesvasile.com"
> > [2] id:"1330812262-28272-1-git-send-email-tbielawa@redhat.com".
> >
> > Signed-off-by: Jani Nikula <jani@nikula.org>
> > ---
> >  emacs/notmuch-mua.el |   10 ++++------
> >  1 files changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> > index 4be7c13..13244eb 100644
> > --- a/emacs/notmuch-mua.el
> > +++ b/emacs/notmuch-mua.el
> > @@ -95,6 +95,9 @@ list."
> >             (goto-char (point-min))
> >             (setq headers (mail-header-extract)))))
> >        (forward-line 1)
> > +      ;; Original message may contain (malicious) MML tags. We must
> > +      ;; properly quote them in the reply.
> > +      (mml-quote-region (point) (point-max))
>
> Under what circumstances can the (re-search-forward "^$" nil t) above
> this code fail?  If it does fail, is it possible for the (forward-line 1)
> to move past an adversary-controlled line of text and fail to quote that
> line?

It doesn't matter. The quoting is done between point and point-max, and the
message body to cite is extracted right after quoting using: (setq body
(buffer-substring (point) (point-max)))).

BR,
Jani.

[-- Attachment #2: Type: text/html, Size: 2676 bytes --]

      reply	other threads:[~2012-03-15  6:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 22:04 [PATCH] Fix mml-quoting in responses where pgp-signing is enabled Tim Bielawa
2012-03-03 23:17 ` Tim Bielawa
2012-03-03 23:36 ` Jani Nikula
2012-03-04  1:12   ` Tim Bielawa
2012-03-04  8:25     ` [PATCH] emacs: fix MML quoting in replies Jani Nikula
2012-03-05  0:41       ` Mark Walters
2012-03-10 14:57       ` Tomi Ollila
2012-03-11  1:50       ` David Bremner
2012-03-14 22:08       ` Austin Clements
2012-03-15  6:33         ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB+hUn8FJ-=CA1JZoYMzH0-E+S9Y75TPqgb1w6YKFuU6=S2Xqw@mail.gmail.com' \
    --to=jani@nikula.org \
    --cc=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).