aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-07-04 14:48:30 (GMT)
committerJouni Malinen <j@w1.fi>2016-07-04 14:49:56 (GMT)
commit73ece491c1295b09f49968447f53ad7b6a378bf8 (patch)
tree52fcaa02e201f0b2b3952e18fcb7887221e3ed86
parent8329ad4d0687c0d4750df36d3e04ca08aefe54bc (diff)
downloadhostap-73ece491c1295b09f49968447f53ad7b6a378bf8.zip
hostap-73ece491c1295b09f49968447f53ad7b6a378bf8.tar.gz
hostap-73ece491c1295b09f49968447f53ad7b6a378bf8.tar.bz2
tests: D-Bus GetAll wpa_config_get_all() OOM
This is a regression test for a crash on wpa_config_get_all() error path. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_dbus.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index 43c0a62..451434d 100644
--- a/tests/hwsim/test_dbus.py
+++ b/tests/hwsim/test_dbus.py
@@ -161,6 +161,27 @@ def test_dbus_getall(dev, apdev):
if ssid != '"test"':
raise Exception("Unexpected SSID in network entry")
+def test_dbus_getall_oom(dev, apdev):
+ """D-Bus GetAll wpa_config_get_all() OOM"""
+ (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
+
+ id = dev[0].add_network()
+ dev[0].set_network(id, "disabled", "0")
+ dev[0].set_network_quoted(id, "ssid", "test")
+
+ res = if_obj.Get(WPAS_DBUS_IFACE, 'Networks',
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ if len(res) != 1:
+ raise Exception("Missing Networks entry: " + str(res))
+ net_obj = bus.get_object(WPAS_DBUS_SERVICE, res[0])
+ for i in range(1, 50):
+ with alloc_fail(dev[0], i, "wpa_config_get_all"):
+ try:
+ props = net_obj.GetAll(WPAS_DBUS_NETWORK,
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ except dbus.exceptions.DBusException, e:
+ pass
+
def dbus_get(dbus, wpas_obj, prop, expect=None, byte_arrays=False):
val = wpas_obj.Get(WPAS_DBUS_SERVICE, prop,
dbus_interface=dbus.PROPERTIES_IFACE,