Comment 5 for bug 1842005

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1842005] Re: Another crash on IP address ending in newline

On Friday, August 30, 2019 12:18:10 AM EDT you wrote:
> Scott, I think there are 2 issues here:
> 1. The bug in pyspf, that causes the policyd-spf crash
> 2. The fact that policyd-spf crashes on an invalid record. Wouldn't a
> try/except block be a better approach? Something like:
>
> try:
> mres = mfromquery.check()
> except Exception as e:
> e = sys.exc_info()
> exceptionmessage = "Exception: %s, locals: %s" %(e, locals())
> syslog.syslog("Ouch, caught exc: %s" %exceptionmessage)
> return(( 'dunno', exceptionmessage, instance_dict, None))

In theory I could do that, but this isn't a case where an error is ever an
appropriate response. pyspf should detect that this is an invalid record by
catching the ipaddress error.

Scott K