Clarifications on the D-Bus specification
remi at remlab.net
Fri Dec 10 10:15:21 PST 2010
On Fri, 10 Dec 2010 10:20:14 -0500, Havoc Pennington <hp at pobox.com> wrote:
> 2010/12/9 Rémi Denis-Courmont <remi at remlab.net>:
>> 1/ Structures cannot be nested more than 32 times. Does that include
>> dictionary entries as well? Or is there no specific limit for dictionary
>> entries? (They can only be inside arrays and array nesting is limited
> I would think that a dict entry counts as a struct here.
> The maximum depth of container type nesting is 32 array
> codes and 32 open parentheses. This implies that the
> total depth of recursion is 64, for an "array of array of
> of ... struct of struct of struct of ..." where there
> array and 32 struct.
>> 2/ What is the limit on variant nesting? I cannot see any mention of
> The limits are really on one signature, so I would think each variant
> contains a new signature and thus would reset the nest limits.
> Really, not sure the nesting limit is that useful since signatures are
> already limited to 255 bytes, that's effectively a cap on nesting
Isn't there a problem if a variant contains a structure of one variant
'(v)', which... countains a structure of one variant '(v)' which countains
a byte? And then iterate that thing many times. To parse the message, a
very very deep recursion will be required when iterating past the top-most
variant (without 'opening' it).
If I'm not mistaken, each variant will occupy 6 bytes. So in even 64kb, you
can fit over 10000 thousands level of recursion, can't you?
More information about the dbus