substitute: Sanitize the client-provided column number.

* guix/scripts/substitute.scm (client-terminal-columns): Sanitize the
client's column number.
This commit is contained in:
Ludovic Courtès 2016-04-20 23:21:49 +02:00
parent 38f50f49f3
commit 85fc958d9b
1 changed files with 3 additions and 1 deletions

View File

@ -981,7 +981,9 @@ found."
default value."
(or (and=> (or (find-daemon-option "untrusted-terminal-columns")
(find-daemon-option "terminal-columns"))
string->number)
(lambda (str)
(let ((number (string->number str)))
(and number (max 20 (- number 1))))))
80))
(define (guix-substitute . args)