diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-11-30 17:23:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 17:23:56 +0100 |
commit | b0d756c93d8deb5d4c6a129c5bd3163dddd10132 (patch) | |
tree | 4aeeae8ec9af66067ff2b83d03653156d53c640d /plumbing/format/pktline/scanner.go | |
parent | 606370479fbf0e315ccffcea8d86126c4a0c9db2 (diff) | |
download | go-git-b0d756c93d8deb5d4c6a129c5bd3163dddd10132.tar.gz |
format/pktline: fix readPayloadLen err handling (#148)
Diffstat (limited to 'plumbing/format/pktline/scanner.go')
-rw-r--r-- | plumbing/format/pktline/scanner.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plumbing/format/pktline/scanner.go b/plumbing/format/pktline/scanner.go index 3ce2adf..4eec18c 100644 --- a/plumbing/format/pktline/scanner.go +++ b/plumbing/format/pktline/scanner.go @@ -80,10 +80,11 @@ func (s *Scanner) Bytes() []byte { // pkt-len and substracting the pkt-len size. func (s *Scanner) readPayloadLen() (int, error) { if _, err := io.ReadFull(s.r, s.len[:]); err != nil { - if err == io.EOF { - return 0, err + if err == io.ErrUnexpectedEOF { + return 0, ErrInvalidPktLen } - return 0, ErrInvalidPktLen + + return 0, err } n, err := hexDecode(s.len) |