From 37eaa296798c5112eb4e1559aeec66c011d311cf Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 11 Apr 2023 21:52:39 -0400 Subject: [PATCH] Fix crash due to extra right parens in pcad files Fixes sentry KICAD-TA --- pcbnew/plugins/pcad/s_expr_loader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/plugins/pcad/s_expr_loader.cpp b/pcbnew/plugins/pcad/s_expr_loader.cpp index c0aa0a9c8d..cb5b8b52c4 100644 --- a/pcbnew/plugins/pcad/s_expr_loader.cpp +++ b/pcbnew/plugins/pcad/s_expr_loader.cpp @@ -70,6 +70,10 @@ static const char ACCEL_ASCII_KEYWORD[] = "ACCEL_ASCII"; if( tok == DSN_RIGHT ) { iNode = iNode->GetParent(); + + // this will happen if there are more right parens than left + if( !iNode ) + THROW_IO_ERROR( wxT( "Unexpected right paren" ) ); } else if( tok == DSN_LEFT ) {