unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	 Stephen Leake <stephen_leake@stephe-leake.org>
Cc: emacs-devel@gnu.org
Subject: Re: check argument count in defcustom :safe?
Date: Sun, 12 Apr 2015 06:45:04 +0000	[thread overview]
Message-ID: <CAArVCkRUCUMMEHJFae9SJ+_6ngtzAL9s5H6NaQB4-XG6q_6O5g@mail.gmail.com> (raw)
In-Reply-To: <jwv8udyj9sf.fsf-monnier+emacs@gnu.org>

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

Stefan Monnier <monnier@iro.umontreal.ca> schrieb am So., 12. Apr. 2015 um
05:48 Uhr:

> The number of arguments passed to a function is something that can be
> easily checked by the function, but checking the number of arguments
> accepted by a function is generally impossible (think of a function like
>
>    (lambda (&rest args)
>      (if (> (length args) (if (halting-p (car args)) 2 3))
>          (signal 'wrong-number-of-arguments 'foo (length args)))
>      ...)
>

But most functions are well-behaved and don't impose additional
restrictions over those expressed in their parameter declaration; in these
cases inspecting the argument list using help-function-arglist should work
well enough.
Agreed that using this as safe predicate is a security hole, the choices
should just be normal symbols that are not used as functions.

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

  reply	other threads:[~2015-04-12  6:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11 15:42 check argument count in defcustom :safe? Stephen Leake
2015-04-12  3:48 ` Stefan Monnier
2015-04-12  6:45   ` Philipp Stephani [this message]
2015-04-12 10:00     ` Artur Malabarba
2015-04-12 11:59     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAArVCkRUCUMMEHJFae9SJ+_6ngtzAL9s5H6NaQB4-XG6q_6O5g@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen_leake@stephe-leake.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://git.savannah.gnu.org/cgit/emacs.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).