-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,567 changed files
with
30,168 additions
and
23,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# iText Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
We are committed to maintaining the security of our software. If you discover a security vulnerability, we encourage you to report it to us as soon as possible. | ||
|
||
To report a vulnerability, please visit our [Vulnerability Reporting Page](https://itextpdf.com/report-vulnerability), or email [[email protected]]([email protected]). If you do not receive a response in 2 business days, please follow up as we may not have received your message. | ||
|
||
We follow the procedure of Coordinated Vulnerability Disclosure (CVD) and, to protect the ecosystem, we request that those reporting do the same. Please visit the above page for more information, and follow the steps below to ensure that your report is handled promptly and appropriately: | ||
|
||
1. **Do not disclose the vulnerability publicly** until we have had a chance to address it. | ||
2. **Provide a detailed description** of the vulnerability, including steps to reproduce it, if possible. | ||
3. **Include any relevant information** such as the version of iText Core you are using, your operating system, and any other pertinent details. | ||
|
||
## Security Updates and Patches | ||
|
||
When a vulnerability is reported, we will: | ||
|
||
1. **Investigate and verify** the vulnerability. | ||
2. **Develop and test** a fix for the vulnerability. | ||
3. **Release a patch** as soon as possible. | ||
|
||
|
||
## Known Vulnerabilities | ||
|
||
The iText Knowledge Base has a page for known [Common Vulnerabilities and Exposures](https://kb.itextpdf.com/itext/cves) (CVEs), please check it to ensure your vulnerability has not already been disclosed or addressed. | ||
|
||
## Supported product lines | ||
|
||
See [Compatibility Matrix](https://kb.itextpdf.com/itext/compatibility-matrix) | ||
|
||
## Security Best Practices | ||
|
||
To help ensure the security of your applications using iText Core, we recommend the following best practices: | ||
|
||
1. **Keep iText Core up to date** by regularly checking for and applying updates. | ||
2. **Review and follow** our security guidelines for secure usage. | ||
3. **Monitor your applications** for any unusual activity and investigate any anomalies promptly. | ||
|
||
Thank you for helping us keep iText secure! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
213 changes: 213 additions & 0 deletions
213
....tests/itext.commons.tests/itext/commons/datastructures/portable/NullUnlimitedListTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 Apryse Group NV | ||
Authors: Apryse Software. | ||
This program is offered under a commercial and under the AGPL license. | ||
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. | ||
AGPL licensing: | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using iText.Commons.Datastructures; | ||
using iText.Test; | ||
|
||
namespace iText.Commons.Datastructures.Portable { | ||
[NUnit.Framework.Category("UnitTest")] | ||
public class NullUnlimitedListTest : ExtendedITextTest { | ||
[NUnit.Framework.Test] | ||
public virtual void NullUnlimitedListAddTest() { | ||
NullUnlimitedList<String> list = new NullUnlimitedList<String>(); | ||
list.Add("hey"); | ||
list.Add("bye"); | ||
NUnit.Framework.Assert.AreEqual(2, list.Size()); | ||
list.Add(-1, "hello"); | ||
list.Add(3, "goodbye"); | ||
NUnit.Framework.Assert.AreEqual(2, list.Size()); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void NullUnlimitedListIndexOfTest() { | ||
NullUnlimitedList<String> list = new NullUnlimitedList<String>(); | ||
list.Add("hey"); | ||
list.Add(null); | ||
list.Add("bye"); | ||
list.Add(null); | ||
NUnit.Framework.Assert.AreEqual(4, list.Size()); | ||
NUnit.Framework.Assert.AreEqual(1, list.IndexOf(null)); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void NullUnlimitedListRemoveTest() { | ||
NullUnlimitedList<String> list = new NullUnlimitedList<String>(); | ||
list.Add("hey"); | ||
list.Add("bye"); | ||
NUnit.Framework.Assert.AreEqual(2, list.Size()); | ||
list.Remove(-1); | ||
list.Remove(2); | ||
NUnit.Framework.Assert.AreEqual(2, list.Size()); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestIsEmpty() { | ||
NullUnlimitedList<String> list = new NullUnlimitedList<String>(); | ||
NUnit.Framework.Assert.IsTrue(list.IsEmpty()); | ||
list.Add("hey"); | ||
NUnit.Framework.Assert.IsFalse(list.IsEmpty()); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour01() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(1, list.IndexOf(null))); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour02() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(4, list.Size())); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour03() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => list.Set(1, "4")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(list.Get(1), "4")); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour04() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add(null)); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(1, list.IndexOf(null))); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour05() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(-1, list.IndexOf(null))); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour06() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => list.Add("5")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(4, list.IndexOf("5"))); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour07() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => list.Add("5")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(-1, list.IndexOf("6"))); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour08() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => list.Add(2, "5")); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(5, list.Size())); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour09() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => list.Set(2, null)); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(4, list.Size())); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour10() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => list.Remove(2)); | ||
actionList.Add((list) => NUnit.Framework.Assert.AreEqual(3, list.Size())); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestSameBehaviour11() { | ||
IList<Action<ISimpleList<String>>> actionList = new List<Action<ISimpleList<String>>>(); | ||
actionList.Add((list) => NUnit.Framework.Assert.IsTrue(list.IsEmpty())); | ||
actionList.Add((list) => list.Add("1")); | ||
actionList.Add((list) => NUnit.Framework.Assert.IsFalse(list.IsEmpty())); | ||
actionList.Add((list) => list.Add("2")); | ||
actionList.Add((list) => list.Add("3")); | ||
actionList.Add((list) => list.Add("4")); | ||
actionList.Add((list) => NUnit.Framework.Assert.IsFalse(list.IsEmpty())); | ||
ExecuteActions(actionList); | ||
} | ||
|
||
public virtual void ExecuteActions(IList<Action<ISimpleList<String>>> actionList) { | ||
NullUnlimitedList<String> list = new NullUnlimitedList<String>(); | ||
SimpleArrayList<String> list2 = new SimpleArrayList<String>(); | ||
foreach (Action<ISimpleList<String>> action in actionList) { | ||
action(list); | ||
action(list2); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.