all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@gnu.org>
To: Leo <sdl.web@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: /srv/bzr/emacs/trunk r107337: Protect fileio.c primitives against invalid file handler return values.
Date: Mon, 20 Feb 2012 10:02:18 +0800	[thread overview]
Message-ID: <8739a645zp.fsf@gnu.org> (raw)
In-Reply-To: <m1linye1hs.fsf@gmail.com> (Leo's message of "Mon, 20 Feb 2012 09:29:19 +0800")

Leo <sdl.web@gmail.com> writes:

> Thank you for fixing the crash.
>
> On 2012-02-19 17:58 +0800, Chong Yidong wrote:
>> +      error ("Invalid handler in `file-name-handler-alist'");
>
> By looking at the doc-string of file-name-handler-alist, it seems
> '("asdf" . ignore) is perfectly legitimate. Why is it invalid?

This is explained in more detail in (elisp)Magic File Names:

  The handler function must handle all of the above operations, and
  possibly others to be added in the future.  It need not implement all
  these operations itself--when it has nothing special to do for a
  certain operation, it can reinvoke the primitive, to handle the
  operation "in the usual way."  It should always reinvoke the primitive
  for an operation it does not recognize.

If the handler function returns an object of the wrong type, and that is
not caught, Emacs is liable to crash if that return value is used in C
code.



  reply	other threads:[~2012-02-20  2:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Rz3pU-00020m-C6@vcs.savannah.gnu.org>
2012-02-20  1:29 ` /srv/bzr/emacs/trunk r107337: Protect fileio.c primitives against invalid file handler return values Leo
2012-02-20  2:02   ` Chong Yidong [this message]
2012-02-20  2:30     ` Leo
2012-02-20  3:39     ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=8739a645zp.fsf@gnu.org \
    --to=cyd@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=sdl.web@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.