[patch] validate dict entries have two elements (TODO item)

John (J5) Palmieri johnp at redhat.com
Mon Jun 6 19:30:26 PDT 2005


After banging my head on this for a bit I came back from some dinner and
was able to figure it out.  All this just to validate that a dict entry
has only two elements ;-)

Validating signatures can now cause OOM errors since I use a stack to
keep track of the number of elements in each container.  This caused the
tests to fail in a number of cases as we now return
DBUS_VALIDITY_UNKNOWN_OOM_ERROR when we encounter OOM.  The rest of the
patch is to handle DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we
used to use DBUS_VALID along with a FALSE return value to indicate OOM.
This patch passes make check with flying colors.

The code for counting elements is generic though we might want to think
about restricting it to only using the stack when within a dict_entry
element since that is all we are validating.

-- 
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_validate_dict_entry.patch
Type: text/x-patch
Size: 11290 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050606/6a13b95b/dbus_validate_dict_entry.bin


More information about the dbus mailing list