mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
making TarArchiveReader more resilient when faced with OARs created by
ancient tars.
This commit is contained in:
@@ -63,7 +63,11 @@ namespace OpenSim.Framework.Serialization
|
||||
/// <summary>
|
||||
/// Used to trim off null chars
|
||||
/// </summary>
|
||||
protected char[] m_nullCharArray = new char[] { '\0' };
|
||||
protected static char[] m_nullCharArray = new char[] { '\0' };
|
||||
/// <summary>
|
||||
/// Used to trim off space chars
|
||||
/// </summary>
|
||||
protected static char[] m_spaceCharArray = new char[] { ' ' };
|
||||
|
||||
/// <summary>
|
||||
/// Generate a tar reader which reads from the given stream.
|
||||
@@ -195,7 +199,9 @@ namespace OpenSim.Framework.Serialization
|
||||
/// <returns></returns>
|
||||
public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count)
|
||||
{
|
||||
string oString = m_asciiEncoding.GetString(bytes, startIndex, count);
|
||||
// Trim leading white space: ancient tars do that instead
|
||||
// of leading 0s :-( don't ask. really.
|
||||
string oString = m_asciiEncoding.GetString(bytes, startIndex, count).TrimStart(m_spaceCharArray);
|
||||
|
||||
int d = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user