From 8576a4a067987e7fe0fee7c622dfd9d46d60c2c1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 10 Jan 2020 17:29:21 +0000 Subject: [PATCH] Fix unchecked array access (from Coverity scan). --- eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index ed8b004719..c4653df1af 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -123,7 +123,8 @@ public: val = g_shapeNames[ pin->GetShape() ]; break; case COL_ORIENTATION: - val = g_orientationNames[ LIB_PIN::GetOrientationIndex( pin->GetOrientation() ) ]; + if( LIB_PIN::GetOrientationIndex( pin->GetOrientation() ) >= 0 ) + val = g_orientationNames[ LIB_PIN::GetOrientationIndex( pin->GetOrientation() ) ]; break; case COL_NUMBER_SIZE: val = StringFromValue( aUserUnits, pin->GetNumberTextSize(), true, true );