Skip to content

Improve argument validation in hist.c#157

Open
hello8693 wants to merge 1 commit into
zsh-users:masterfrom
hello8693:patch-1
Open

Improve argument validation in hist.c#157
hello8693 wants to merge 1 commit into
zsh-users:masterfrom
hello8693:patch-1

Conversation

@hello8693

Copy link
Copy Markdown

This pull request makes a small but important fix to the argument validation logic in the getargs function in Src/hist.c. The change ensures that negative word indices are properly rejected, which improves error handling and prevents potential out-of-bounds access.

  • Improved input validation in getargs by explicitly checking for negative values of arg1 and arg2, preventing invalid negative indices from being processed.

@Jun-T

Jun-T commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Do you have an example use case that gives negative arg1 or arg2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants