Add latest changes from gitlab-org/security/gitlab@14-5-stable-ee
This commit is contained in:
parent
7418d0b3eb
commit
f617de3476
|
|
@ -29,9 +29,7 @@ module Gitlab
|
|||
# Anything, including `/cmd arg` which are ignored by this filter
|
||||
# `
|
||||
|
||||
`\n*
|
||||
.+?
|
||||
\n*`
|
||||
`.+?`
|
||||
)
|
||||
}mix.freeze
|
||||
|
||||
|
|
|
|||
|
|
@ -352,6 +352,14 @@ RSpec.describe Gitlab::QuickActions::Extractor do
|
|||
expect(commands).to eq(expected_commands)
|
||||
expect(msg).to eq expected_msg
|
||||
end
|
||||
|
||||
it 'fails fast for strings with many newlines' do
|
||||
msg = '`' + "\n" * 100_000
|
||||
|
||||
expect do
|
||||
Timeout.timeout(3.seconds) { extractor.extract_commands(msg) }
|
||||
end.not_to raise_error
|
||||
end
|
||||
end
|
||||
|
||||
describe '#redact_commands' do
|
||||
|
|
|
|||
Loading…
Reference in New Issue