mirror of https://github.com/yeka/zip.git
Check error return from mac.Write
This commit is contained in:
parent
42f3489e0b
commit
8ac7f2d858
|
@ -209,7 +209,11 @@ func (a *bufferedAuthReader) Read(b []byte) (int, error) {
|
||||||
a.err = ErrDecryption
|
a.err = ErrDecryption
|
||||||
return 0, a.err
|
return 0, a.err
|
||||||
}
|
}
|
||||||
a.mac.Write(a.buf.Bytes())
|
mn, err := a.mac.Write(a.buf.Bytes())
|
||||||
|
if mn != a.buf.Len() || err != nil {
|
||||||
|
a.err = ErrDecryption
|
||||||
|
return 0, a.err
|
||||||
|
}
|
||||||
if !a.checkAuthentication(ab.Bytes()) {
|
if !a.checkAuthentication(ab.Bytes()) {
|
||||||
a.err = ErrDecryption
|
a.err = ErrDecryption
|
||||||
return 0, a.err
|
return 0, a.err
|
||||||
|
|
Loading…
Reference in New Issue