From 3faa5deaa509012069afe75cd03c21bda5050a64 Mon Sep 17 00:00:00 2001 From: avere001 Date: Tue, 9 Jun 2015 14:35:27 -0700 Subject: [PATCH] fixed escape sequence vulnerability --- scripts/config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.sh b/scripts/config.sh index db8b799..f9bb7e3 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -346,16 +346,16 @@ function isGraded { # $1 = the grade file function getGrade { - head -n 1 "$1" | cut -d'/' -f1 | sed 's/ *//g' + head -n 1 "$1" | cut -d'/' -f1 | sed 's/ *//g' | sed 's/[^[:digit:].]//g' #head -n 1 "$1" | sed 's/\// /' | awk '{print $1;}' } # $1 = the grade file function getOutOf { if isGraded $1; then - head -n 1 "$1" | sed 's/\// /' | awk '{print $2;}' + head -n 1 "$1" | sed 's/\// /' | awk '{print $2;}' | sed 's/[^[:digit:].]//g' else - head -n 1 "$1" | sed 's/\// /' | awk '{print $1;}' + head -n 1 "$1" | sed 's/\// /' | awk '{print $1;}' | sed 's/[^[:digit:].]//g' fi }