Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Doulik <rodo@xamarin.com>2015-04-07 23:45:38 +0300
committerJb Evain <jbevain@gmail.com>2015-04-27 17:21:45 +0300
commit717b17c577a7b2f197f5b2159647e194cede0812 (patch)
tree279945fb3389b2f4c9fa1f199dc4e4ca5503963d
parent92e87d149e7d14f17dd439b5dc6eaa8bef8faa90 (diff)
do not read behind signature boundaries
- when NumNamed count is wrong - assemblies with such a problem are used in #28198
-rw-r--r--Mono.Cecil/AssemblyReader.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs
index 6ea6a1e..ee440cf 100644
--- a/Mono.Cecil/AssemblyReader.cs
+++ b/Mono.Cecil/AssemblyReader.cs
@@ -2948,8 +2948,11 @@ namespace Mono.Cecil {
public void ReadCustomAttributeNamedArguments (ushort count, ref Collection<CustomAttributeNamedArgument> fields, ref Collection<CustomAttributeNamedArgument> properties)
{
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++) {
+ if (!CanReadMore ())
+ return;
ReadCustomAttributeNamedArgument (ref fields, ref properties);
+ }
}
void ReadCustomAttributeNamedArgument (ref Collection<CustomAttributeNamedArgument> fields, ref Collection<CustomAttributeNamedArgument> properties)