erbot-discuss
[Top][All Lists]
Advanced

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

Re: [Erbot-discuss] Limiting length of lists for user functions


From: Michael Olson
Subject: Re: [Erbot-discuss] Limiting length of lists for user functions
Date: Tue, 08 Nov 2005 20:27:17 -0500
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Michael Olson <address@hidden> writes:

> One of the users of my bot instance found a way to crash Emacs 22
> with a user-defined function.
>
> (defun fs-boom
>   (fs-l)
>   (sit-for 0)
>   (fs-boom
>    (fs-concatenate 'list fs-l fs-l fs-l fs-l fs-l fs-l fs-l)))
>
> Input: boom (list 1 1)
>
>[snip]
>  2. Limit the length of each argument to some configurable value

I've now implemented a solution for this.  Please be sure to add the
following line to every function in the userfunctions.el for your bot
instance, replacing ARGS with the arguments to the function.

(erblisp-check-args ARGS)

It should come just before the (sit-for 0) line.

The maximum number of allowable items in a list may be specified with
the erblisp-max-list-length variable.  The default is 100.  Note that
this will also limit the size of user functions to that number of
items.

-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: anime, Debian, XHTML, wiki, Emacs Lisp
  /` |\ | | | IRC: mwolson on freenode.net: #hcoop, #muse, #PurdueLUG
 |_] | \| |_| Jabber: mwolson_at_hcoop.net

Attachment: pgpfBFH2Gn5w0.pgp
Description: PGP signature


reply via email to

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