Commit 7723356
committed
fix: reject trailing newline in tool-name validation
TOOL_NAME_REGEX was end-anchored with $, which in Python's default mode also
matches just before a single trailing newline. So validate_tool_name("x\n")
returned is_valid=True with no warning, and a 127-char name plus "\n" (len
128) slipped past both the length and character checks. Anchor with \Z so a
trailing newline is treated as the disallowed character it is.1 parent 9bdc03d commit 7723356
2 files changed
Lines changed: 20 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
83 | 99 | | |
84 | 100 | | |
85 | 101 | | |
| |||
0 commit comments