Don't try to convert non-UTF8 strings in plugin

This gives asan fits as the strlen overruns.  These are not UTF-8
strings anyways
This commit is contained in:
Seth Hillbrand 2024-05-27 11:29:49 -07:00
parent 54efd32f7a
commit 0881fc8aa9
1 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
char const* cp = pp->GetFileFilter( i ); char const* cp = pp->GetFileFilter( i );
if( cp ) if( cp )
addFilterString( wxString::FromUTF8Unchecked( cp ) ); addFilterString( cp );
} }
addExtensionMap( pp ); addExtensionMap( pp );
@ -328,7 +328,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
++bl; ++bl;
} }
// prevent loading non-plugin dlls // prevent loading non-plugin dlls
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{ {
if( !path.GetName().StartsWith( "s3d_plugin" ) if( !path.GetName().StartsWith( "s3d_plugin" )
@ -416,7 +416,7 @@ void S3D_PLUGIN_MANAGER::addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin )
wxString ws; wxString ws;
if( cp ) if( cp )
ws = wxString::FromUTF8Unchecked( cp ); ws = wxString( cp );
if( !ws.empty() ) if( !ws.empty() )
{ {