aboutsummaryrefslogtreecommitdiffstats
path: root/wpaspy/wpaspy.py
diff options
context:
space:
mode:
authorJonathan Afek <jonathan@wizery.com>2016-05-19 13:06:47 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-28 13:34:09 (GMT)
commit93568233bc518bffb5680a0dbc42fb8fada87d1e (patch)
tree33c7244926e9fef8914c20d7e3f1c14fa48ef3cd /wpaspy/wpaspy.py
parent5b45f478c28a5e48b25222ae60be4f60f48244c0 (diff)
downloadhostap-93568233bc518bffb5680a0dbc42fb8fada87d1e.zip
hostap-93568233bc518bffb5680a0dbc42fb8fada87d1e.tar.gz
hostap-93568233bc518bffb5680a0dbc42fb8fada87d1e.tar.bz2
wpaspy: Fix potentially referencing non existing attribute
In wpaspy.py in the Ctrl object constructor there is a try/except. In the except part the code references the s attribute of the object. This attribute is only created later in the try part. If an exception occurs before the attribute creation then the except part references a non existing attribute. Fix that by assigning None to the s attribute at the beginning of the try part. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
Diffstat (limited to 'wpaspy/wpaspy.py')
-rw-r--r--wpaspy/wpaspy.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py
index 809b4ce..c2aace0 100644
--- a/wpaspy/wpaspy.py
+++ b/wpaspy/wpaspy.py
@@ -44,6 +44,7 @@ class Ctrl:
raise
else:
try:
+ self.s = None
ai_list = socket.getaddrinfo(path, port, socket.AF_INET,
socket.SOCK_DGRAM)
for af, socktype, proto, cn, sockaddr in ai_list: