# HG changeset patch # User Paul Boddie # Date 1411570112 -7200 # Node ID c38609e4aef22fb1fb9cfa4d86fc131f13117c4b # Parent d3472eab62fc417120a9417f3f3c9a745d00dc5d Ignore invalid input and adopt a conservative error strategy. diff -r d3472eab62fc -r c38609e4aef2 imip_agent.py --- a/imip_agent.py Wed Sep 24 16:35:16 2014 +0200 +++ b/imip_agent.py Wed Sep 24 16:48:32 2014 +0200 @@ -27,21 +27,7 @@ # Postfix exit codes. -EX_USAGE = 64 -EX_DATAERR = 65 -EX_NOINPUT = 66 -EX_NOUSER = 67 -EX_NOHOST = 68 -EX_UNAVAILABLE = 69 -EX_SOFTWARE = 70 -EX_OSERR = 71 -EX_OSFILE = 72 -EX_CANTCREAT = 73 -EX_IOERR = 74 EX_TEMPFAIL = 75 -EX_PROTOCOL = 76 -EX_NOPERM = 77 -EX_CONFIG = 78 # Permitted iTIP content types. @@ -263,8 +249,11 @@ f = StringIO(part.get_payload(decode=True)) itip = parse_object(f, part.get_content_charset(), "VCALENDAR") + + # Ignore the part if not a calendar object. + if not itip: - sys.exit(EX_DATAERR) + return [] # Only handle calendar information.