mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
Check path length on adding them to the cache and log error if a path is too long.
This commit is contained in:
parent
09417bd6c1
commit
5b5a1e2fd8
5 changed files with 10 additions and 5 deletions
|
|
@ -35,7 +35,7 @@ public static unsafe partial class ByteStringFunctions
|
|||
var path = ( byte* )Marshal.AllocHGlobal( length + 1 );
|
||||
fixed( char* ptr = s )
|
||||
{
|
||||
Encoding.UTF8.GetBytes( ptr, length, path, length + 1 );
|
||||
Encoding.UTF8.GetBytes( ptr, s.Length, path, length + 1 );
|
||||
}
|
||||
|
||||
path[ length ] = 0;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public readonly struct Utf8RelPath : IEquatable< Utf8RelPath >, IComparable< Utf
|
|||
return true;
|
||||
}
|
||||
|
||||
var substring = s!.Replace( '/', '\\' ).TrimStart('\\');
|
||||
var substring = s.Replace( '/', '\\' ).TrimStart('\\');
|
||||
if( substring.Length > MaxRelPathLength )
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue