summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-01-25 13:23:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-01-25 18:29:54 +0100
commitbb913f14b25ae0cf31649b6894fd00745acd37a1 (patch)
treecf406e26e609e07a30245e8a6dddf963f4de6cb9 /vcl
parent681872593c83dbab9a98352f9a1a74a0d059e5ec (diff)
Argument to PPDContext::getModifiedKey is known to never be negative
...if you check all its current call sites Change-Id: Idbe7c659d25e1ec2f356581a22fbcbe71df1b0a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87389 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index a8554055ab8b..c1f61fae7794 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cassert>
#include <stdlib.h>
#include <comphelper/string.hxx>
@@ -1646,6 +1649,7 @@ PPDContext& PPDContext::operator=( PPDContext&& rCopy )
const PPDKey* PPDContext::getModifiedKey( int n ) const
{
+ assert(n >= 0);
if( m_aCurrentValues.size() <= static_cast<hash_type::size_type>(n) )
return nullptr;