diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-04-03 09:57:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 09:57:09 +0200 |
commit | 247cf690745dfd67ccd9f0c07878e6dd85e6c9ed (patch) | |
tree | d75d3fb55548d3cdbd87cc7e5c7cbe5d1baa3b8d /plumbing/format/pktline/scanner_test.go | |
parent | 2cbff8d8ffa42dd1b399b3c94d094bdb2d1cdf5c (diff) | |
parent | b4177b89c08b3cd7c791f223b4828b4a81a62312 (diff) | |
download | go-git-247cf690745dfd67ccd9f0c07878e6dd85e6c9ed.tar.gz |
Merge pull request #797 from jvusich/fix/oversize-pkt-linev4.2.1
plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes
Diffstat (limited to 'plumbing/format/pktline/scanner_test.go')
-rw-r--r-- | plumbing/format/pktline/scanner_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plumbing/format/pktline/scanner_test.go b/plumbing/format/pktline/scanner_test.go index 048ea38..9660c2d 100644 --- a/plumbing/format/pktline/scanner_test.go +++ b/plumbing/format/pktline/scanner_test.go @@ -20,7 +20,7 @@ func (s *SuiteScanner) TestInvalid(c *C) { for _, test := range [...]string{ "0001", "0002", "0003", "0004", "0001asdfsadf", "0004foo", - "fff1", "fff2", + "fff5", "ffff", "gorka", "0", "003", " 5a", "5 a", "5 \n", @@ -34,6 +34,20 @@ func (s *SuiteScanner) TestInvalid(c *C) { } } +func (s *SuiteScanner) TestDecodeOversizePktLines(c *C) { + for _, test := range [...]string{ + "fff1" + strings.Repeat("a", 0xfff1), + "fff2" + strings.Repeat("a", 0xfff2), + "fff3" + strings.Repeat("a", 0xfff3), + "fff4" + strings.Repeat("a", 0xfff4), + } { + r := strings.NewReader(test) + sc := pktline.NewScanner(r) + _ = sc.Scan() + c.Assert(sc.Err(), IsNil) + } +} + func (s *SuiteScanner) TestEmptyReader(c *C) { r := strings.NewReader("") sc := pktline.NewScanner(r) |