File tree Expand file tree Collapse file tree
NanaZip.Core/SevenZip/CPP/7zip/UI/Common
NanaZip.Universal/SevenZip/CPP/7zip/UI/Common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,13 +96,20 @@ static void ReplaceIncorrectChars(UString &s)
9696void Correct_AltStream_Name (UString &s)
9797{
9898 unsigned len = s.Len ();
99+ // **************** NanaZip Modification Start ****************
100+ // ":$DATA" match suppressed in NanaZip because of security risk.
101+ // For example, ":Zone.Identifier:$DATA" can be used to bypass rejection of
102+ // Zone.Identifier streams embedded in the archive.
103+ #if 0 // ******** Annotated 7-Zip Mainline Source Code snippet Start ********
99104 const unsigned kPostfixSize = 6;
100105 if (s.Len() >= kPostfixSize
101106 && StringsAreEqualNoCase_Ascii(s.RightPtr(kPostfixSize), ":$DATA"))
102107 {
103108 len -= kPostfixSize;
104109 s.DeleteFrom(len);
105110 }
111+ #endif // ******** Annotated 7-Zip Mainline Source Code snippet End ********
112+ // **************** NanaZip Modification End ****************
106113 for (unsigned i = 0 ; i < len; i++)
107114 {
108115 const wchar_t c = s[i];
Original file line number Diff line number Diff line change @@ -96,13 +96,20 @@ static void ReplaceIncorrectChars(UString &s)
9696void Correct_AltStream_Name (UString &s)
9797{
9898 unsigned len = s.Len ();
99+ // **************** NanaZip Modification Start ****************
100+ // ":$DATA" match suppressed in NanaZip because of security risk.
101+ // For example, ":Zone.Identifier:$DATA" can be used to bypass rejection of
102+ // Zone.Identifier streams embedded in the archive.
103+ #if 0 // ******** Annotated 7-Zip Mainline Source Code snippet Start ********
99104 const unsigned kPostfixSize = 6;
100105 if (s.Len() >= kPostfixSize
101106 && StringsAreEqualNoCase_Ascii(s.RightPtr(kPostfixSize), ":$DATA"))
102107 {
103108 len -= kPostfixSize;
104109 s.DeleteFrom(len);
105110 }
111+ #endif // ******** Annotated 7-Zip Mainline Source Code snippet End ********
112+ // **************** NanaZip Modification End ****************
106113 for (unsigned i = 0 ; i < len; i++)
107114 {
108115 const wchar_t c = s[i];
You can’t perform that action at this time.
0 commit comments