Skip to content

Commit

Permalink
Add line length limit in Solidity bounty (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli authored Sep 8, 2024
1 parent 1665181 commit 0fae649
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/bounties/solidity-bounty/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ if [ $status -ne 1 ]; then
exit 1
fi

#
# Validate line length limit - Avoids extremely long SPDX license identifiers,
# which causes catastrophic backtracking in regex pattern matching
# See: https://github.com/ethereum/solidity/issues/12208
#
awk 'length > 1000 { exit 1 }' $1
status=$?
if [ $status -ne 0 ]; then
>&2 echo "Invalid exploit code: Exceeded line length limit"
exit 1
fi

#
# Run the exploit code
Expand Down

0 comments on commit 0fae649

Please sign in to comment.