From 1c5ace4b7ae4b99a12697237a747640d6acbf059 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 1 Jul 2017 16:59:07 +0200 Subject: [PATCH] Eagle plugin: avoid hanging if an unexpected keyword is found. Fixes: lp:1701672 https://bugs.launchpad.net/kicad/+bug/1701672 --- pcbnew/eagle_plugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index eac2185a22..01e866fa3b 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -824,7 +824,12 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements ) while( element ) { if( element->GetName() != "element" ) + { + wxLogMessage( "expected: read <%s>. Skip it", element->GetName() ); + // Get next item + element = element->GetNext(); continue; + } EELEMENT e( element ); @@ -909,7 +914,11 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements ) while( attribute ) { if( attribute->GetName() != "attribute" ) + { + wxLogMessage( "expected: read <%s>. Skip it", attribute->GetName() ); + attribute = attribute->GetNext(); continue; + } EATTR a( attribute );