[patch] Implement an element counting stack so we can validate dicts have only two elements (TODO Item)

John (J5) Palmieri johnp at redhat.com
Thu Jun 2 19:19:39 PDT 2005


I was going to do this recursively but the stack seems much more elegant
being that we only need it to validate DICT_ENTRYs.  This patch is not
done and I don't know if it works yet but I wanted input on if this is
the right way to go.

Things that need to be cleaned up in this patch:
1. Provide a fail: label so we can goto that instead of clearing the
stack at every failure point
2. Check for OOM when appending to the stack
3. Get rid of the variable called "last" and just use the stack to
validate the same conditions
4. Make sure we also clean up the stack on the first
DBUS_INVALID_SIGNATURE_TOO_LONG failure (just caught this and too sleepy
to generate new patch ;-)

-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-element-count-stack.patch
Type: text/x-patch
Size: 4885 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050602/eb445bc9/dbus-element-count-stack.bin


More information about the dbus mailing list