gdbus: fix out-of-bound array access
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Fri, 6 Mar 2015 14:22:33 +0000 (15:22 +0100)
committerMarc-André Lureau <marcandre.lureau@gmail.com>
Tue, 21 Apr 2015 20:54:34 +0000 (22:54 +0200)
commit41acf970accd25c4446e8f28c0b817e332722c23
treea0a360f149a85994af87fac5fe23376206369cd2
parent9bc3ae920731448575741bf0a799a32c9c1a6668
gdbus: fix out-of-bound array access

In path_rule_matches(), the given paths may be of 0-length. Do not
access memory before the array in those case. This is for example
triggered by:

test_match_rule (con, G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH, "/", "", FALSE);

in test_connection_signal_match_rules().

This bug was found thanks to GCC AddressSanitizer.

https://bugzilla.gnome.org/show_bug.cgi?id=745745
gio/gdbusconnection.c