{"record":{"id":"10c0e074401b71ce","repo":"peass-ng/PEASS-ng","slug":"same-key-already-exists-10c0e0","errorCode":null,"errorMessage":"Same key already exists.","messagePattern":"Same key already exists\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs","lineNumber":312,"sourceCode":"            class KeyValue\n            {\n                public int hash;\n                public K key;\n                public V value;\n                public KeyValue(K key, V value)\n                {\n                    this.key = key;\n                    this.value = value;\n                    this.hash = key.GetHashCode();\n                }\n            }\n\n            #region IDictionary<K,V> メンバ\n\n            public void Add(K key, V value)\n            {\n                if ( hashes.ContainsKey(key) )\n                    throw new ArgumentException(\"Same key already exists.\");\n                var entry = new KeyValue(key, value);\n                object item;\n                if ( items.TryGetValue(entry.hash, out item) ) {\n\n                } else {\n                }\n            }\n\n            public bool ContainsKey(K key)\n            {\n                throw new NotImplementedException();\n            }\n\n            public ICollection<K> Keys\n            {\n                get { throw new NotImplementedException(); }\n            }\n","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs#L294-L330","documentation":"A duplicate-key guard in the internal hash-map Add of TypeUtils: before inserting the new KeyValue the code checks hashes.ContainsKey(key) and rejects the Add because the key is already present — the standard dictionary duplicate-insert contract.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use ContainsKey or TryGetValue before Add to decide insert vs update","Use an overwrite semantics (indexer) where duplicates should replace","Ensure keys are unique by construction before populating the map"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}