diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-04-20 23:21:49 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-20 23:21:49 +0200 |
commit | 85fc958d9b8b36fb4b540882dfbcec45aab9eb82 (patch) | |
tree | ea201e1ee414a0a53bdda30962501448371a4eb3 | |
parent | 38f50f49f395fcda6ab3395ebaa312f8ee24d80d (diff) | |
download | guix-85fc958d9b8b36fb4b540882dfbcec45aab9eb82.tar.gz |
substitute: Sanitize the client-provided column number.
* guix/scripts/substitute.scm (client-terminal-columns): Sanitize the client's column number.
-rwxr-xr-x | guix/scripts/substitute.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index fa1dd09df8..1cfab81dbd 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -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) |