From af5e3aaca960e2df2629522d11677b39be3305ad Mon Sep 17 00:00:00 2001 From: derv82 Date: Tue, 27 Feb 2018 04:20:21 -0500 Subject: [PATCH] Ignore error when parsing Client row. Explanation of bug (Why error wasn't being caught): ``` try: ... except IndexError, ValueError: # Only catches IndexError. # ValueError is a *variable* holding the IndexError ! ``` --- py/Airodump.py | 2 +- py/Client.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/py/Airodump.py b/py/Airodump.py index 6de6f54..783861f 100644 --- a/py/Airodump.py +++ b/py/Airodump.py @@ -193,7 +193,7 @@ class Airodump(object): # The current row corresponds to a "Client" (computer) try: client = Client(row) - except IndexError, ValueError: + except (IndexError, ValueError) as e: # Skip if we can't parse the client row continue diff --git a/py/Client.py b/py/Client.py index 2ae4b5c..51a6918 100644 --- a/py/Client.py +++ b/py/Client.py @@ -21,15 +21,10 @@ class Client(object): 5 BSSID, (Access Point's MAC address) 6 Probed ESSIDs ''' - try: - self.station = fields[0].strip() - self.power = int(fields[3].strip()) - self.packets = int(fields[4].strip()) - self.bssid = fields[5].strip() - except ValueError, e: - print "\nValueError ({})".format(e) - print "\twhile parsing {}".format(fields) - raise e + self.station = fields[0].strip() + self.power = int(fields[3].strip()) + self.packets = int(fields[4].strip()) + self.bssid = fields[5].strip() def __str__(self):