Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/scripts/supervisor-archived/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ cmd_batch() {
return 1
}
# GH#3716: Validate concurrency is a positive integer before SQL interpolation
if ! [[ "$2" =~ ^[0-9]+$ ]] || [[ "$2" -eq 0 ]]; then
if ! [[ "$2" =~ ^[1-9][0-9]*$ ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new regex ^[1-9][0-9]*$ is stricter than the original logic. It will now reject valid positive integer representations with leading zeros, like 01, which the previous check allowed. This is a subtle change in validation logic.

If the intent is to allow any valid positive integer representation, a regex that permits leading zeros while still excluding zero itself would be more appropriate, for example: ^(0*[1-9][0-9]*)$.

Suggested change
if ! [[ "$2" =~ ^[1-9][0-9]*$ ]]; then
if ! [[ "$2" =~ ^(0*[1-9][0-9]*)$ ]]; then

log_error "--concurrency must be a positive integer, got: $2"
return 1
fi
Expand Down
Loading