From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel 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 Message-ID: <8739a645zp.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329703358 13543 80.91.229.3 (20 Feb 2012 02:02:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2012 02:02:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Leo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 20 03:02:35 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RzIaF-0007My-C9 for ged-emacs-devel@m.gmane.org; Mon, 20 Feb 2012 03:02:31 +0100 Original-Received: from localhost ([::1]:50581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzIaE-0007AM-Fq for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2012 21:02:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzIaC-0007AG-VJ for emacs-devel@gnu.org; Sun, 19 Feb 2012 21:02:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzIaB-000603-QW for emacs-devel@gnu.org; Sun, 19 Feb 2012 21:02:28 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:38201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzIaB-0005zz-Nq for emacs-devel@gnu.org; Sun, 19 Feb 2012 21:02:27 -0500 Original-Received: from bb121-6-68-155.singnet.com.sg ([121.6.68.155]:39182 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RzIaA-00052A-KN; Sun, 19 Feb 2012 21:02:27 -0500 In-Reply-To: (Leo's message of "Mon, 20 Feb 2012 09:29:19 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148669 Archived-At: Leo 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.