Skip to content

Commit

Permalink
fixed escape sequence vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
avere001 committed Jun 9, 2015
1 parent 91ef674 commit 3faa5de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 3faa5de

Please sign in to comment.