[Libreoffice-commits] core.git: vcl/unx

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 25 17:30:24 UTC 2020


 vcl/unx/generic/printer/ppdparser.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit bb913f14b25ae0cf31649b6894fd00745acd37a1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Jan 25 13:23:45 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Jan 25 18:29:54 2020 +0100

    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 at redhat.com>

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;
 


More information about the Libreoffice-commits mailing list