From 0674dd36b6a344acc3f22676d8aa09158e17062f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 21 Nov 2014 09:49:27 +0000 Subject: coverity#1242675 Untrusted value as argument Change-Id: Id1f1ff8de23b041742d2a8286b78312529f6566e --- package/source/zipapi/ZipFile.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'package') 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 aNameBuffer(nPathLenToRead); -- cgit