mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 08:51:14 -03:00
Fix #9899 integer overflow in string repeat
We could end up overflowing if we print out something that's a multiple of the chunk size, which would then finish printing in the chunk-printing, but not break out early.
This commit is contained in:
committed by
Fabian Boehm
parent
2a13a30807
commit
6325b3662d
@@ -530,6 +530,10 @@ string repeat -n 17 a | string length
|
||||
string repeat -m 5 (string repeat -n 500000 aaaaaaaaaaaaaaaaaa) | string length
|
||||
# CHECK: 5
|
||||
|
||||
# might cause integer overflow
|
||||
string repeat -n 2999 \n | count
|
||||
# CHECK: 3000
|
||||
|
||||
# Test equivalent matches with/without the --entire, --regex, and --invert flags.
|
||||
string match -e x abc dxf xyz jkx x z
|
||||
or echo exit 1
|
||||
|
||||
Reference in New Issue
Block a user