Skip to content

Commit

Permalink
Apply some validation to the git-branch argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaudwell committed Mar 25, 2014
1 parent f2d9548 commit f099701
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gource_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,15 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc

if(!entry->hasValue()) conffile.missingValueException(entry);

git_branch = entry->getString();
Regex branch_regex("^[/\\w.,;_=+{}\\[\\]-]+$");

std::string branch = entry->getString();

if(branch_regex.match(branch)) {
git_branch = branch;
} else {
conffile.invalidValueException(entry);
}
}

if(gource_settings->getBool("colour-images")) {
Expand Down

0 comments on commit f099701

Please sign in to comment.