diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-21 09:49:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-21 11:55:12 +0000 |
commit | 0674dd36b6a344acc3f22676d8aa09158e17062f (patch) | |
tree | e1c8357389903742428ff4411bf0b48b80ac30ad | |
parent | af4700d70a807857ecb118c2bd23c023cfe387e7 (diff) |
coverity#1242675 Untrusted value as argument
Change-Id: Id1f1ff8de23b041742d2a8286b78312529f6566e
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index bb178f5a8ef5..f2dc709423f1 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -664,6 +664,8 @@ bool ZipFile::readLOC( ZipEntry &rEntry ) const sal_Int64 nBytesAvailable = aGrabber.getLength() - aGrabber.getPosition(); if (nPathLenToRead > nBytesAvailable) nPathLenToRead = nBytesAvailable; + else if (nPathLenToRead < 0) + nPathLenToRead = 0; // read always in UTF8, some tools seem not to set UTF8 bit uno::Sequence<sal_Int8> aNameBuffer(nPathLenToRead); |