mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
feat(dotenv): check for .env file size to prevent DoS
This commit is contained in:
parent
2014363332
commit
e6ab2b3645
2 changed files with 20 additions and 0 deletions
|
|
@ -27,6 +27,13 @@
|
|||
assert $state equals 1
|
||||
}
|
||||
|
||||
@test 'parse returns error for oversized file (> 10MiB)' {
|
||||
command truncate -s 11M "$fixture" 2>/dev/null
|
||||
|
||||
run _parse_dotenv_quiet "$fixture" "test"
|
||||
assert $state equals 1
|
||||
}
|
||||
|
||||
@test 'parse returns error for non-existent file' {
|
||||
run _parse_dotenv_quiet "/nonexistent/path/.env" "test"
|
||||
assert $state equals 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue