From: Jouni Malinen Date: Sun, 19 Jul 2015 19:36:35 +0000 (+0300) Subject: tests: wpa_supplicant ctrl_iface network OOM in string parsing X-Git-Tag: hostap_2_5~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccfe3e5db9a1647833bd30da605ae30b7d7833ab;p=thirdparty%2Fhostap.git tests: wpa_supplicant ctrl_iface network OOM in string parsing Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 8fbbcfdd5..a94b41837 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -231,6 +231,19 @@ def test_wpas_ctrl_network(dev): if "FAIL" not in dev[0].request("SET_NETWORK %d bssid_blacklist %s" % (id, val)): raise Exception("Invalid bssid_blacklist value accepted") +def test_wpas_ctrl_network_oom(dev): + """wpa_supplicant ctrl_iface network OOM in string parsing""" + id = dev[0].add_network() + + tests = [ ('"foo"', 1, 'dup_binstr;wpa_config_set'), + ('P"foo"', 1, 'dup_binstr;wpa_config_set'), + ('P"foo"', 2, 'wpa_config_set'), + ('112233', 1, 'wpa_config_set') ] + for val,count,func in tests: + with alloc_fail(dev[0], count, func): + if "FAIL" not in dev[0].request("SET_NETWORK " + str(id) + ' ssid ' + val): + raise Exception("Unexpected success for SET_NETWORK during OOM") + def test_wpas_ctrl_many_networks(dev, apdev): """wpa_supplicant ctrl_iface LIST_NETWORKS with huge number of networks""" for i in range(1000):