session: Handle empty AllowedBearers
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 7 Apr 2011 08:13:41 +0000 (10:13 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 7 Apr 2011 14:35:15 +0000 (16:35 +0200)
commit16c04696ff458c57b054cf3c8ab68c9d83880430
tree91d4e361f2a94b8989c80851759b0d67eee978a2
parent28691db5337e195cb7f7c249eec668bb832b99f0
session: Handle empty AllowedBearers

If no AllowedBearers is set the match any rules apply. Add a match all
entry to the session->allowed_bearers. Otherwise, a NULL pointer is
assigned to session->bearer which leads to an crash:

#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:32
#1  0x000000310842889b in marshal_string (str=0x6a19c0, insert_at=24,
    type=<value optimized out>, value=<value optimized out>, byte_order=108, pos_after=
    0x7fffffffe140) at dbus-marshal-basic.c:778
#2  _dbus_marshal_write_basic (str=0x6a19c0, insert_at=24, type=<value optimized out>,
    value=<value optimized out>, byte_order=108, pos_after=0x7fffffffe140)
    at dbus-marshal-basic.c:858
#3  0x00000031084162e9 in _dbus_type_writer_write_basic_no_typecode (writer=0x7fffffffe120,
    type=115, value=<value optimized out>) at dbus-marshal-recursive.c:1589
#4  _dbus_type_writer_write_basic (writer=0x7fffffffe120, type=115,
    value=<value optimized out>) at dbus-marshal-recursive.c:2311
#5  0x000000310841a1e6 in dbus_message_iter_append_basic (iter=0x7fffffffe110, type=115, value=
    0x6acf10) at dbus-message.c:2563
#6  0x00000000004588d5 in connman_dbus_property_append_basic (iter=0x7fffffffe190, key=
    0x475c33 "Bearer", type=115, val=0x6acf10) at src/dbus.c:117
#7  0x000000000045ccb3 in connman_dbus_dict_append_basic (dict=0x7fffffffe260, key=
    0x475c33 "Bearer", type=115, val=0x6acf10) at ./include/connman/dbus.h:112
#8  0x000000000045d36a in append_service (dict=0x7fffffffe260, session=0x6acef0)
    at src/session.c:292
#9  0x000000000045d434 in append_notify_all (dict=0x7fffffffe260, session=0x6acef0)
    at src/session.c:317
#10 0x000000000045d652 in session_notify_all (user_data=0x6acef0) at src/session.c:375
#11 0x00000031078435eb in g_timeout_dispatch (source=<value optimized out>,
    callback=<value optimized out>, user_data=<value optimized out>) at gmain.c:3585
#12 0x0000003107841e33 in g_main_dispatch (context=0x695100) at gmain.c:2149
#13 g_main_context_dispatch (context=0x695100) at gmain.c:2702
#14 0x0000003107842610 in g_main_context_iterate (context=0x695100, block=1, dispatch=1,
    self=<value optimized out>) at gmain.c:2780
#15 0x0000003107842c82 in g_main_loop_run (loop=0x6951e0) at gmain.c:2988
#16 0x000000000042e5e3 in main (argc=1, argv=0x7fffffffe698) at src/main.c:303
src/session.c