Commit 39d4fbe8 authored by James Lopez's avatar James Lopez

Merge branch 'sh-handle-invalid-gitattributes' into 'master'

Ignore .gitattributes if they contain invalid byte sequences

Closes #216210

See merge request gitlab-org/gitlab!30922
parents 8f71fa99 f638643f
---
title: Ignore .gitattributes if they contain invalid byte sequences
merge_request: 30922
author:
type: fixed
......@@ -85,6 +85,8 @@ module Gitlab
yield line.strip
end
# Catch invalid byte sequences
rescue ArgumentError
end
private
......
......@@ -75,6 +75,14 @@ describe Gitlab::Git::AttributesParser, :seed_helper do
expect(subject.attributes('test.foo')).to eq({})
end
end
context 'when attributes data has binary data' do
let(:data) { "\xFF\xFE*\u0000.\u0000c\u0000s".b }
it 'returns an empty Hash' do
expect(subject.attributes('test.foo')).to eq({})
end
end
end
describe '#patterns' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment