Protect against bad values in `current-module-declare-name'.
Closes PR 12125
This commit is contained in:
parent
5cc277e40f
commit
f02d19553c
|
@ -897,6 +897,9 @@
|
||||||
,@(sandbox-path-permissions))]
|
,@(sandbox-path-permissions))]
|
||||||
;; general info
|
;; general info
|
||||||
[current-command-line-arguments '#()]
|
[current-command-line-arguments '#()]
|
||||||
|
;; prevent a potential value here from messing up creating the sandboxed
|
||||||
|
;; module
|
||||||
|
[current-module-declare-name #f]
|
||||||
;; restrict the sandbox context from this point
|
;; restrict the sandbox context from this point
|
||||||
[current-security-guard
|
[current-security-guard
|
||||||
(let ([g (sandbox-security-guard)]) (if (security-guard? g) g (g)))]
|
(let ([g (sandbox-security-guard)]) (if (security-guard? g) g (g)))]
|
||||||
|
|
|
@ -500,4 +500,11 @@
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(parameterize ([current-module-declare-name (make-resolved-module-path 'junk)])
|
||||||
|
(define (avoid-module-declare-name)
|
||||||
|
(with-handlers ([exn? (lambda (_) #f)])
|
||||||
|
(kill-evaluator (make-evaluator 'racket/base))
|
||||||
|
#t))
|
||||||
|
(test #t avoid-module-declare-name))
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user