emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check argument count in defcustom :safe?


From: Philipp Stephani
Subject: Re: check argument count in defcustom :safe?
Date: Sun, 12 Apr 2015 06:45:04 +0000



Stefan Monnier <address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]