From 102367a7330cf72ff5e753da3df8bca70ced74af Mon Sep 17 00:00:00 2001 From: ycoheNvidia <99744138+ycoheNvidia@users.noreply.github.com> Date: Thu, 3 Aug 2023 01:56:10 +0300 Subject: [PATCH] Input check for timeout in generate_dump (#2925) #### What I did Added input check for argument "-t" in generate_dump script #### How I did it Made sure only integer values can be received for this argument #### How to verify it Call generate_dump -t with non-integer values --- scripts/generate_dump | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/generate_dump b/scripts/generate_dump index 2b454049a1..af6c07e1cc 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -1881,6 +1881,10 @@ while getopts ":xnvhzas:t:r:d" opt; do date --date="${SINCE_DATE}" &> /dev/null || abort "${EXT_INVALID_ARGUMENT}" "Invalid date expression passed: '${SINCE_DATE}'" ;; t) + if ! [[ ${OPTARG} =~ ^[0-9]+$ ]]; then + echo "Invalid timeout value: ${OPTARG}, Please enter a numeric value." + exit $EXT_GENERAL + fi TIMEOUT_MIN="${OPTARG}" ;; r)