Catch UnicodeDecodeErrors in id verification

Do not crash if the id cannot be decoded. An invalid id provided by an untrusted client can DOS the master.
This commit is contained in:
Massimiliano Torromeo 2018-12-04 16:09:52 +01:00 committed by Ch3LL
parent 858cfac113
commit fd73f86c75
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -490,7 +490,7 @@ def valid_id(opts, id_):
if any(x in id_ for x in ('/', '\\', '\0')):
return False
return bool(clean_path(opts['pki_dir'], id_))
except (AttributeError, KeyError, TypeError):
except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
return False