Skip to content

YamlStream.Load throws ArgumentException #374

Description

@Metalnem

YamlStream.Load throws an ArgumentException (YamlException is expected) when loading the document from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):

using (var file = File.OpenText(path))
{
  new YamlStream().Load(file);
}

Full stack trace:

An unhandled exception of type 'System.ArgumentException' occurred in System.Private.CoreLib.dll: 'An item with the same key has already been added. Key: '
   at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at YamlDotNet.RepresentationModel.YamlMappingNode.ResolveAliases(DocumentLoadingState state)
   at YamlDotNet.RepresentationModel.DocumentLoadingState.ResolveAliases()
   at YamlDotNet.RepresentationModel.YamlDocument..ctor(IParser parser)
   at YamlDotNet.RepresentationModel.YamlStream.Load(IParser parser)

Found via SharpFuzz.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions