History log of /external/dbus/dbus/dbus-marshal-validate.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4299eb3c0907100fe95d2986984b48d40cc52841 08-Jul-2015 Daniel Erat <derat@google.com> Incorporate upstream changes to v1.6.8.

Squash upstream commits up to and including the v1.6.8
release (upstream commit 1cad15cc).

This repository's changes from upstream are now limited to:

- addition of Android.mk, CleanSpec.mk, config.h, and NOTICE
files
- addition of dbus/dbus-arch-deps.h and removal from
dbus/.gitignore (ebae2d21, f022f55d)
- WANT_PIDFILE #ifdefs added to bus/bus.c to disable writing
dbus-daemon's PID to a file (3100d06a)
- TRACE_LOCKS set to 0 in dbus/dbus-connection.c (88a0ffe5)
- DBUS_ANDROID_LOG added to dbus/dbus-internals.c to use
logcat (7de15def)
- ANDROID_MANAGED_SOCKET added to dbus/dbus-sysdeps-unix.c
to use an SELinux-managed socket rather than a
dbus-daemon-created Unix domain socket (3100d06a)

Bug: 22328216
Change-Id: I793ebdf963d9b0740f0da28f1de593d088f08406
/external/dbus/dbus/dbus-marshal-validate.c
c11401949f29a97414887a01f0d3e6e8fe60ba40 13-Dec-2010 Havoc Pennington <hp@pobox.com> CVE 2010-4352: Reject deeply nested variants

Add DBUS_INVALID_NESTED_TOO_DEEPLY validity problem and a test that
should generate it.

Previously, we rejected deep nesting in the signature, but
variants allow dynamic message nesting, conditional only
on the depth of the message body.

The nesting limit is 64, which was also the limit in static
signatures. Empirically, dynamic nesting depth observed on my
Fedora 14 system doesn't exceed 2; 64 is really a huge limit.

https://bugs.freedesktop.org/show_bug.cgi?id=32321

Signed-Off-By: Colin Walters <walters@verbum.org>
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
/external/dbus/dbus/dbus-marshal-validate.c
dbecdeabb20e0ce11121819c63373f0afba57c58 19-Mar-2010 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> Consistently include <config.h> in all C source files and never in header files.
/external/dbus/dbus/dbus-marshal-validate.c
37019e9d271390fa8c62c1aae62d30bb9068adaa 16-Jul-2009 Thiago Macieira <thiago@kde.org> Merge branch 'fd-passing'

Conflicts:
dbus/dbus-connection.c
dbus/dbus-message-util.c
dbus/dbus-sysdeps-unix.c
5baf2f856a9c6625993234855b07680da1c8916f 11-Jul-2009 Tobias Mueller <fdo-bugs@cryptobitch.de> Bug 21161 - Update the FSF address

No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/dbus/dbus-marshal-validate.c
ba7daa606cf20ff3b5e992907f380a425feaef01 22-Apr-2009 Lennart Poettering <lennart@poettering.net> unix-fd: add basic marshalling code for unix fds

This is actually pretty boring since we store our fds as indexes that
are stored as uint32_t's.
/external/dbus/dbus/dbus-marshal-validate.c
099b5e59ea84d72bfe29a17e0934f6b2f492ddf3 18-Mar-2009 Federico Mena Quintero <federico@novell.com> bfo20738 - Translate DBusValidity into error message

Signed-off-by: Federico Mena Quintero <federico@novell.com>
/external/dbus/dbus/dbus-marshal-validate.c
e8f8c1c5a2bddfbf43c168323c9c9fd78f51a643 01-Apr-2009 Colin Walters <walters@verbum.org> Bug 17803 - Fix both test case and validation logic

The previous commit had errors in both the test case and
the validation logic. The test case was missing a trailing
comma before the previous one, so we weren't testing the
signature we thought we were.

The validation logic was wrong because if the type was not valid,
we'd drop through the entire if clause, and thus skip returning
an error code, and accept the signature.
/external/dbus/dbus/dbus-marshal-validate.c
e61f13cf328d131ddbd8b49842fcd0f49847dbff 11-Nov-2008 Jon Gosting <yukarionsen@gmail.com> Bug 18064 - more efficient validation for fixed-size type arrays

* dbus/dbus-marshal-validate.c: If an array is fixed size,
skip validation

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/dbus/dbus-marshal-validate.c
7b10b46c5c8658449783ce45f1273dd35c353bce 01-Oct-2008 Colin Walters <walters@verbum.org> Bug 17803: Panic from dbus_signature_validate

* dbus/dbus-marshal-validate.c: Ensure we validate
a basic type before calling is_basic on it.
* dbus-marshal-validate-util.c: Test.
/external/dbus/dbus/dbus-marshal-validate.c
2349aa6d711d0abc938edd05e2e483813f6e720e 10-Oct-2007 Simon McVittie <simon.mcvittie@collabora.co.uk> dbus/dbus-marshal-validate.c: get rid of empty statements
/external/dbus/dbus/dbus-marshal-validate.c
d012387afef0ba02185ebe27bc6bb15551912e92 14-Jul-2007 Havoc Pennington <hp@redhat.com> 2007-07-13 Havoc Pennington <hp@redhat.com>

* Add indent-tabs-mode: nil to all file headers.
/external/dbus/dbus/dbus-marshal-validate.c
7652304bff969afb3969603149bb385efe861fe8 03-Aug-2006 John (J5) Palmieri <johnp@redhat.com> * s/D-BUS/D-Bus/g
/external/dbus/dbus/dbus-marshal-validate.c
b459906a7a6519c034f5882c472f0c945371dfc6 17-Jul-2006 John (J5) Palmieri <johnp@redhat.com> * doc/TODO:
* dbus/dbus-bus.c:
* dbus-errors.c:
* dbus/dbus-marshal-validate.c:
Removed TODO items which were fixed or are no longer relevent
/external/dbus/dbus/dbus-marshal-validate.c
8b34c2c538f182fe29af58f5153b9dd7cdbaf7fa 12-Sep-2005 Waldo Bastian <bastian@kde.org> * dbus/dbus-marshal-validate.c, doc/dbus-specification.xml,
test/Makefile.am, test/test-names.c: allow hyphens in bus names.
/external/dbus/dbus/dbus-marshal-validate.c
5e389fdf499c39926c61b47fcafb5e71291ce1a2 15-Jun-2005 John (J5) Palmieri <johnp@redhat.com> * dbus/dbus-marshal-validate.h: Added a new validation
error code DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4 for
out of memory errors when validating signitures

* dbus/dbus-marshal-header.c: use DBUS_VALIDITY_UNKNOWN_OOM_ERROR
in places where we previously used DBUS_VALID and a FALSE return
value to indicate OOM

* dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason):
Use a stack to track the number of elements inside containers. The
stack values are then used to validate that dict entries have only two
elements within them.
(validate_body_helper): check the reason for failure when validating
varients

* dbus/dbus-message.c (load_message): use
DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used
DBUS_VALID and a FALSE return value to indicate OOM

* doc/TODO: remove "- validate dict entry number of fields" as this
patch fixes it
/external/dbus/dbus/dbus-marshal-validate.c
54a2e9f7961b4b8afff94bb0c5b756f986965be6 24-Feb-2005 Colin Walters <walters@verbum.org> 2005-02-24 Colin Walters <walters@verbum.org>

* dbus/dbus-signature.c: New file; implements various functions
related to type signatures. Includes an interator for parsing,
validation functions.
(dbus_type_is_basic): Moved here from
dbus-marshal-basic.c:_dbus_type_is_basic.
(dbus_type_is_container): Moved here from
dbus-marshal-basic.c:_dbus_type_is_container.

All callers of _dbus_type_is_container and _dbus_type_is_basic
updated, and include dbus-signature.h.

* dbus/dbus-signature.h: New file; prototypes for the above.

* dbus/Makefile.am (DBUS_LIB_SOURCES): Add dbus-signature.c,
dbus-signature.h.

* dbus/dbus-marshal-basic.c (map_type_char_to_type): New utility
function factored out of _dbus_first_type_in_signature.
(_dbus_first_type_in_signature_c_str): New function; returns first
type code for a type signature character.

* dbus/dbus-marshal-basic.h: Prototype _dbus_first_type_in_signature_c_str,
handle function moves.

* dbus/dbus-marshal-recursive.h: Export _dbus_type_signature_next.

* dbus/dbus-marshal-recursive.c (_dbus_type_signature_next): New
function; skips to next complete type in type signature.
Implemented using previous skip_one_complete_type. Now
skip_one_complete_type just delegates to
_dbus_type_signature_next.

* dbus/dbus-marshal-basic.c (_dbus_type_is_basic): Moved
to dbus-signature.c
(_dbus_type_is_container): Ditto.

* doc/dbus-specification.xml: Update introspection sample to
use real type signatures.

* dbus/dbus-test.h: Prototype signature test.

* dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Run
signature tests.

* dbus/dbus-protocol.h (DBUS_ERROR_INVALID_SIGNATURE): New error.
/external/dbus/dbus/dbus-marshal-validate.c
71f3b461b371d6bf7c7bc4e92578420b78d5c0d8 11-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-10 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message-factory.c (generate_special): modify test to
avoid using a non-basic dict key

* dbus/dbus-marshal-validate-util.c: add test for the below

* doc/dbus-specification.xml: require that dict keys are a basic
type

* dbus/dbus-marshal-validate.c
(_dbus_validate_signature_with_reason): require that dict key is a
basic type
/external/dbus/dbus/dbus-marshal-validate.c
96a47516321dea8c08e1ab15ac0102ce3c3ae3f1 06-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-06 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message-factory.c (generate_special): more tests

* dbus/dbus-marshal-validate.c (validate_body_helper): detect
array length that exceeds the maximum
/external/dbus/dbus/dbus-marshal-validate.c
8f04e1e01f51fa9bef564dbaf29be59694407d21 06-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-05 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message-factory.c (generate_special): more test cases,
increasing coverage

* dbus/dbus-marshal-validate.c (validate_body_helper): return the
reason why a signature was invalid

* dbus/dbus-marshal-header.c (load_and_validate_field): fix to
skip the length of the string before we look at it in validation

* dbus/dbus-string-util.c (_dbus_string_test): add tests for
equal_substring

* dbus/dbus-message.c (_dbus_message_loader_new): default
max_message_length to DBUS_MAXIMUM_MESSAGE_LENGTH
/external/dbus/dbus/dbus-marshal-validate.c
0e53d4eed36f378e99802e516fbb0d1355641902 05-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-05 Havoc Pennington <hp@redhat.com>

* dbus/dbus-marshal-validate.c (validate_body_helper): fix crash
if the signature of a variant was empty
(_dbus_validate_signature_with_reason): catch "(a)" (array inside
struct with no element type)

* dbus/dbus-message-factory.c (generate_uint32_changed): add more
mangled messages to break things
/external/dbus/dbus/dbus-marshal-validate.c
98ad8a8ec6626f7f5c78915b6bdf2be688b4839f 30-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-30 Havoc Pennington <hp@redhat.com>

* glib/dbus-gobject.c (introspect_properties): fix the XML
generated

* dbus/dbus-message.c (dbus_message_unref): add an in_cache flag
which effectively detects the use of freed messages

* glib/dbus-gobject.c (handle_introspect): modify and return the
reply message instead of the incoming message

* dbus/dbus-object-tree.c (handle_default_introspect_unlocked):
gee, maybe it should SEND THE XML instead of just making a string
and freeing it again ;-)

* tools/dbus-print-message.c (print_message): improve printing of
messages

* configure.in: add debug-glib.service to the output
/external/dbus/dbus/dbus-marshal-validate.c
41f52c96d651003b3d0a266a582d401228a8368e 30-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-30 Havoc Pennington <hp@redhat.com>

dbus-viewer introspected and displayed the bus driver

* dbus/dbus-object-tree.c
(object_tree_test_iteration): add tests for a handler registered on "/"

* dbus/dbus-object-tree.c
(_dbus_decompose_path): fix to handle path "/" properly
(run_decompose_tests): add tests for path decomposition

* glib/dbus-gutils.c (_dbus_gutils_split_path): fix to handle "/"
properly

* glib/dbus-gobject.c (handle_introspect): fix quotes

* test/glib/run-test.sh: support launching the bus, then running
dbus-viewer

* test/glib/test-service-glib.c (main): put in a trivial gobject
subclass and register it on the connection

* bus/driver.c (bus_driver_handle_introspect): implement
introspection of the bus driver service

* dbus/dbus-protocol.h: add #defines for the XML namespace,
identifiers, doctype decl

* bus/driver.c (bus_driver_handle_get_service_owner): handle
attempts to get owner of DBUS_SERVICE_ORG_FREEDESKTOP_DBUS by
returning the service unchanged.
(bus_driver_handle_message): remove old check for reply_serial in
method calls, now the message type deals with that
(bus_driver_handle_message): handle NULL interface

* glib/dbus-gproxy.c (dbus_g_proxy_get_bus_name): new function

* glib/dbus-gloader-expat.c (description_load_from_string): allow
-1 for len

* tools/dbus-viewer.c: add support for introspecting a service on
a bus

* glib/dbus-gproxy.c (dbus_g_pending_call_ref): add
(dbus_g_pending_call_unref): add
/external/dbus/dbus/dbus-marshal-validate.c
c7816d45e82ba8dd7e1e969c2cb6c3a27577cf68 28-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-28 Havoc Pennington <hp@redhat.com>

* doc/dbus-specification.xml: update to describe 16-bit types and
dict entries

* dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken
assertion

* dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a
type

* dbus/dbus-marshal-recursive.c: implement
/external/dbus/dbus/dbus-marshal-validate.c
3ed9db546e1143bc9aa2d83a6f423fdd81227352 28-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-27 Havoc Pennington <hp@redhat.com>

* dbus/dbus-arch-deps.h.in: add 16/32-bit types

* configure.in: find the right type for 16 and 32 bit ints as well
as 64

* dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add
the 16-bit types so people don't have to stuff them in 32-bit or
byte arrays.
/external/dbus/dbus/dbus-marshal-validate.c
fddbc09c4a9125fcb168fb31ff300d4132919ea6 28-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-27 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message.c: byteswap the message if you init an
iterator to read/write from it

* dbus/dbus-marshal-byteswap.c: new file implementing
_dbus_marshal_byteswap()

* dbus/dbus-marshal-basic.c: add _dbus_swap_array()
/external/dbus/dbus/dbus-marshal-validate.c
382d5ad0b4adf0070948fc2da623bc52894a7788 27-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-26 Havoc Pennington <hp@redhat.com>

* dbus/dbus-marshal-validate-util.c: break this out (and fix
build, apparently - nobody noticed?)
/external/dbus/dbus/dbus-marshal-validate.c
72c433f80ba964f03688b61ff754b1c93d0fb4ad 24-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-24 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message-factory.c: more testing of message validation

* dbus/dbus-protocol.h (DBUS_MINIMUM_HEADER_SIZE): move to this
header
/external/dbus/dbus/dbus-marshal-validate.c
8873c90f99303f9cc308f15f8d03e637911f5b9e 18-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-18 Havoc Pennington <hp@redhat.com>

* Throughout, grand renaming to strip out the use of "service",
just say "name" instead (or "bus name" when ambiguous). Did not
change the internal code of the message bus itself, only the
programmer-facing API and messages.

* doc/dbus-specification.xml: further update the message bus section

* bus/config-parser.c (all_are_equiv): fix bug using freed string
in error case
/external/dbus/dbus/dbus-marshal-validate.c
4fce285052c143296cd9e08a48de0175b5207853 18-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-17 Havoc Pennington <hp@redhat.com>

* dbus/dbus-types.h: remove 16-bit types since we don't use them
ever

* dbus/dbus-marshal-validate.c (_dbus_validate_path): disallow any
"invalid name character" not only non-ASCII

* doc/dbus-specification.xml: further update spec, message bus
parts are still out-of-date but the marshaling etc. stuff is now
accurate-ish
/external/dbus/dbus/dbus-marshal-validate.c
ad937e16957c76f21b0df79d742cb4c401d2abb9 17-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-17 Havoc Pennington <hp@redhat.com>

* Throughout, align variant bodies according to the contained
type, rather than always to 8. Should save a fair bit of space in
message headers.

* dbus/dbus-marshal-validate.c (_dbus_validate_body_with_reason):
fix handling of case where p == end

* doc/TODO: remove the dbus_bool_t item and variant alignment items
/external/dbus/dbus/dbus-marshal-validate.c
62e465339a306fa564b69935da494dad6e1b474a 17-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-17 Havoc Pennington <hp@redhat.com>

* dbus/dbus-types.h: hardcode dbus_bool_t to 32 bits

* Throughout: modify DBUS_TYPE_BOOLEAN to be a 32-bit type instead
of an 8-bit type. Now dbus_bool_t is the type to use whenever you
are marshaling/unmarshaling a boolean.
/external/dbus/dbus/dbus-marshal-validate.c
31988af4089f3793940417535f8eabaae1ac26c8 16-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-16 Havoc Pennington <hp@redhat.com>

* Add and fix docs according to Doxygen warnings throughout
source.

* dbus/dbus-marshal-recursive.c
(_dbus_type_reader_array_is_empty): change this to just call
array_reader_get_array_len() and make it static

* dbus/dbus-message.c (dbus_message_iter_get_element_type): rename
from get_array_type
(dbus_message_iter_init_append): rename from append_iter_init

* dbus/dbus-marshal-recursive.c
(_dbus_type_reader_get_element_type): rename from
_dbus_type_reader_get_array_type
/external/dbus/dbus/dbus-marshal-validate.c
9c3d566e95c9080f6040c64531b0ccae22bd5d74 15-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-15 Havoc Pennington <hp@redhat.com>

* Land the new message args API and type system.

This patch is huge, but the public API change is not
really large. The set of D-BUS types has changed somewhat,
and the arg "getters" are more geared toward language bindings;
they don't make a copy, etc.

There are also some known issues. See these emails for details
on this huge patch:
http://lists.freedesktop.org/archives/dbus/2004-December/001836.html
http://lists.freedesktop.org/archives/dbus/2005-January/001922.html

* dbus/dbus-marshal-*: all the new stuff

* dbus/dbus-message.c: basically rewritten

* dbus/dbus-memory.c (check_guards): with "guards" enabled, init
freed blocks to be all non-nul bytes so using freed memory is less
likely to work right

* dbus/dbus-internals.c (_dbus_test_oom_handling): add
DBUS_FAIL_MALLOC=N environment variable, so you can do
DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
thorough.

* qt/message.cpp: port to the new message args API
(operator<<): use str.utf8() rather than str.unicode()
(pretty sure this is right from the Qt docs?)

* glib/dbus-gvalue.c: port to the new message args API

* bus/dispatch.c, bus/driver.c: port to the new message args API

* dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
"locked" flag to TRUE and align_offset to 0; I guess we never
looked at these anyhow, but seems cleaner.

* dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
move allocation padding macro to this header; use it to implement
(_DBUS_STRING_STATIC): ability to declare a static string.

* dbus/dbus-message.c (_dbus_message_has_type_interface_member):
change to return TRUE if the interface is not set.

* dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
to dbus-marshal-validate.[hc]

* dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
dbus-internals.c

* dbus/Makefile.am: cut over from dbus-marshal.[hc]
to dbus-marshal-*.[hc]

* dbus/dbus-object-tree.c (_dbus_decompose_path): move this
function here from dbus-marshal.c
/external/dbus/dbus/dbus-marshal-validate.c
5c486a24e50ef731b8f970060ab10e928cd0e7cd 03-Jan-2005 Havoc Pennington <hp@redhat.com> add a file to hold the validation routines
/external/dbus/dbus/dbus-marshal-validate.c