From 107b4b84309bcea59efd9804537791aab3c74f46 Mon Sep 17 00:00:00 2001 From: Yona Cohen Date: Thu, 20 Jul 2023 00:14:57 -0700 Subject: [PATCH] Input sanitization for timeout in generate_dump --- scripts/generate_dump | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/generate_dump b/scripts/generate_dump index 36ff8a1e7b0..12ca39bdbd9 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -2020,6 +2020,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)