From c36f3ab5214fadf5fcc3207a631d5fe7ed00737d Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sun, 20 Dec 2020 19:14:00 -0500 Subject: [PATCH] Coverity fix for 280374. --- common/filename_resolver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/filename_resolver.cpp b/common/filename_resolver.cpp index ebc8abb1fa..83a45f64ea 100644 --- a/common/filename_resolver.cpp +++ b/common/filename_resolver.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015-2016 Cirilo Bernardo + * Copyright (C) 2015-2020 Cirilo Bernardo * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -931,7 +931,7 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& i2 += nchars; } - if( aString[i2] != '"' ) + if( i2 >= aString.size() || aString[i2] != '"' ) { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";