Fix (unreported) potential infinite loop over collections' parents pointers.

It is crucial to properly tag as loopback that kind of pointers,
otherwise some users of libquery's foreach_ID might end up in infinite
loops.
This commit is contained in:
Bastien Montagne 2019-04-03 11:05:16 +02:00
parent 986329b4c4
commit a0a08c643e
1 changed files with 1 additions and 1 deletions

View File

@ -783,7 +783,7 @@ static void library_foreach_ID_link(
CALLBACK_INVOKE(child->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_USER);
}
for (CollectionParent *parent = collection->parents.first; parent; parent = parent->next) {
CALLBACK_INVOKE(parent->collection, IDWALK_CB_NEVER_SELF);
CALLBACK_INVOKE(parent->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_LOOPBACK);
}
break;
}