Browse Source

Add check for processing recursive data structures (#14897)

JPVenson 1 week ago
parent
commit
cce6bf27e0
1 changed files with 5 additions and 0 deletions
  1. 5 0
      MediaBrowser.Controller/Entities/Folder.cs

+ 5 - 0
MediaBrowser.Controller/Entities/Folder.cs

@@ -337,6 +337,11 @@ namespace MediaBrowser.Controller.Entities
 
             try
             {
+                if (GetParents().Any(f => f.Id.Equals(Id)))
+                {
+                    throw new InvalidOperationException("Recursive datastructure detected abort processing this item.");
+                }
+
                 await ValidateChildrenInternal2(progress, recursive, refreshChildMetadata, allowRemoveRoot, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false);
             }
             finally