Skip to content
This repository has been archived by the owner on Feb 17, 2018. It is now read-only.

Commit

Permalink
Increase DoS threshhold, minor renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
deego committed Nov 11, 2005
1 parent 2f6fa5b commit bc3eb6d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions erblisp.el
@@ -1,5 +1,5 @@
;;; erblisp.el ---
;; Time-stamp: <2005-09-02 14:18:07 deego>
;; Time-stamp: <2005-11-11 13:28:55 deego>
;; Copyright (C) 2002 D. Goel
;; Emacs Lisp Archive entry
;; Filename: erblisp.el
Expand Down Expand Up @@ -92,9 +92,11 @@ We WON'T do this by default since this could lead to exploits if you
\(setq &rest (shell-command \"rm -rf /\")) in your .emacs."
)

(defvar erblisp-max-list-length 100)
(defvar erblisp-max-list-length 2000
"If non-numeric, we will skip this check."
)

(defun erblisp-safe-length (list so-far len)
(defun erblisp-safe-length-args-p (list so-far len)
(let ((cur list)
stack)
(while (and cur
Expand All @@ -112,7 +114,9 @@ We WON'T do this by default since this could lead to exploits if you
nil)))

(defun erblisp-check-args (&rest args)
(if (erblisp-safe-length args 0 erblisp-max-list-length)
(if (or
(not (numberp erblisp-max-list-length))
(erblisp-safe-length-args-p args 0 erblisp-max-list-length))
t
(error "encountered overlong expression, ignoring")
nil))
Expand Down

0 comments on commit bc3eb6d

Please sign in to comment.