aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-10-02 02:26:56 +0300
committerGitHub <noreply@github.com>2025-10-01 17:26:56 -0600
commitcce6bf27e034b5cd7917242ad6eaa05a6414d7d9 (patch)
tree4b76e569b4c0dcbd686a1ca23c4d47219632390e
parentd6cebf1e67f30063d572519e31b0459b58f3e4b0 (diff)
Add check for processing recursive data structures (#14897)
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 1abb394b5..9950e7852 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/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