dbus: Increase buffer size to fix Introspect XML

Commit e9c3c1afed added a new D-Bus
method and that was enough to push the Introspect XML buffer over
the previously allocated 8000 bytes. Increase the buffer size to
make enough room for P2P interface. In addition, add a debug
message to indicate if an XML segment does not fit into the buffer
to make this types of failures somewhat easier to catch.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2011-12-31 17:40:49 +02:00
parent d033694ac5
commit 6fc74e5181

View File

@ -164,6 +164,12 @@ static void add_interfaces(struct dl_list *list, struct wpabuf *xml)
if (wpabuf_len(iface->xml) + 20 < wpabuf_tailroom(xml)) {
wpabuf_put_buf(xml, iface->xml);
wpabuf_put_str(xml, "</interface>");
} else {
wpa_printf(MSG_DEBUG, "dbus: Not enough room for "
"add_interfaces inspect data: tailroom %u, "
"add %u",
(unsigned int) wpabuf_tailroom(xml),
(unsigned int) wpabuf_len(iface->xml));
}
dl_list_del(&iface->list);
wpabuf_free(iface->xml);
@ -251,7 +257,7 @@ DBusMessage * wpa_dbus_introspect(DBusMessage *message,
DBusMessage *reply;
struct wpabuf *xml;
xml = wpabuf_alloc(8000);
xml = wpabuf_alloc(10000);
if (xml == NULL)
return NULL;