You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2022-11-21T13:50:51.0367367-05:00|INFORMATION|LDAP channel closed, waiting for consumers
2022-11-21T13:50:52.8803968-05:00|ERROR|error in consumer
System.NullReferenceException: Object reference not set to an instance of an object.
at SharpHoundCommonLib.Processors.GPOLocalGroupProcessor.<ProcessGPOXmlFile>d__13.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at SharpHoundCommonLib.Processors.GPOLocalGroupProcessor.<ReadGPOLocalGroups>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sharphound.Runtime.ObjectProcessors.<ProcessDomainObject>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sharphound.Runtime.ObjectProcessors.<ProcessObject>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sharphound.Runtime.LDAPConsumer.<ConsumeSearchResults>d__0.MoveNext()
2022-11-21T13:50:52.9272690-05:00|INFORMATION|Consumers finished, closing output channel
2022-11-21T13:50:53.0366411-05:00|INFORMATION|Output channel closed, waiting for output task to complete
Closing writers
2022-11-21T13:50:53.1460060-05:00|INFORMATION|Status: 42918 objects finished (+6523 232.5313)/s -- Using 448 MB RAM
2022-11-21T13:50:53.1460060-05:00|INFORMATION|Enumeration finished in 00:03:12.3442529
2022-11-21T13:50:56.4988165-05:00|INFORMATION|SharpHound Enumeration Completed at 1:50 PM on 11/21/2022! Happy Graphing!
There error is from here. Nowhere else is ToList() called on ProcessGPOXmlFile objects in that method.
Should probably add some null check for all the ToList() calls in that method, and examine other uses of generators/ToList throughout the codebase for potential problem areas.
ProcessGPOXmlFile is a generator function (returns values via yield). If generator functions never return a value (or break early returning nothing), then null is returned. So you either need to check for null when using generators that might not return something, or ensure all generator functions return something. While initially difficult to do, enabling (nullable types)[https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references] (be it in individual files or project-wide) can help eliminate this bug class throughout the entire codebase (nullable types is enabled by default in new .NET projects).
The text was updated successfully, but these errors were encountered:
This exception occurred during DCOnly collection:
There error is from here. Nowhere else is
ToList()
called onProcessGPOXmlFile
objects in that method.Should probably add some null check for all the
ToList()
calls in that method, and examine other uses of generators/ToList
throughout the codebase for potential problem areas.ProcessGPOXmlFile is a generator function (returns values via yield). If generator functions never return a value (or break early returning nothing), then null is returned. So you either need to check for null when using generators that might not return something, or ensure all generator functions return something. While initially difficult to do, enabling (nullable types)[https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references] (be it in individual files or project-wide) can help eliminate this bug class throughout the entire codebase (nullable types is enabled by default in new .NET projects).
The text was updated successfully, but these errors were encountered: