Commit 772bf3a2 authored by Laurent Aimar's avatar Laurent Aimar

Fixed invalid access in file_select (lua).

parent 4ab06f35
...@@ -139,7 +139,7 @@ static int file_select( const char *file ) ...@@ -139,7 +139,7 @@ static int file_select( const char *file )
for( j = 0; ppsz_lua_exts[j]; j++ ) for( j = 0; ppsz_lua_exts[j]; j++ )
{ {
int l = strlen( ppsz_lua_exts[j] ); int l = strlen( ppsz_lua_exts[j] );
if( !strcmp( file+i-l, ppsz_lua_exts[j] ) ) if( i >= l && !strcmp( file+i-l, ppsz_lua_exts[j] ) )
return 1; return 1;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment