Skip to content

Commit ca1918b

Browse files
author
platfowner
committed
Add input node index range check
1 parent 9d67535 commit ca1918b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

deploy_blockchain_genesis_onprem.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,16 @@ if [[ ! $2 =~ $number_re ]] ; then
2929
printf "Invalid <# of Shards> argument: $2\n"
3030
exit
3131
fi
32+
if [[ $3 -lt 0 ]] || [[ $3 -gt 4 ]]; then
33+
printf "Invalid <Parent Node Index Begin> argument: $3\n"
34+
exit
35+
fi
3236
PARENT_NODE_INDEX_BEGIN=$3
3337
printf "PARENT_NODE_INDEX_BEGIN=$PARENT_NODE_INDEX_BEGIN\n"
38+
if [[ $4 -lt 0 ]] || [[ $4 -gt 4 ]]; then
39+
printf "Invalid <Parent Node Index End> argument: $4\n"
40+
exit
41+
fi
3442
PARENT_NODE_INDEX_END=$4
3543
printf "PARENT_NODE_INDEX_END=$PARENT_NODE_INDEX_END\n"
3644
printf "\n"

deploy_blockchain_incremental_onprem.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,16 @@ if [[ ! $2 =~ $number_re ]] ; then
2929
printf "Invalid <# of Shards> argument: $2\n"
3030
exit
3131
fi
32+
if [[ $3 -lt 0 ]] || [[ $3 -gt 4 ]]; then
33+
printf "Invalid <Parent Node Index Begin> argument: $3\n"
34+
exit
35+
fi
3236
PARENT_NODE_INDEX_BEGIN=$3
3337
printf "PARENT_NODE_INDEX_BEGIN=$PARENT_NODE_INDEX_BEGIN\n"
38+
if [[ $4 -lt 0 ]] || [[ $4 -gt 4 ]]; then
39+
printf "Invalid <Parent Node Index End> argument: $4\n"
40+
exit
41+
fi
3442
PARENT_NODE_INDEX_END=$4
3543
printf "PARENT_NODE_INDEX_END=$PARENT_NODE_INDEX_END\n"
3644
printf "\n"

0 commit comments

Comments
 (0)