Open halayli opened 12 years ago
Yeah, that code is relatively new and could probably use some 'fuzz' testing...
got it. No problem I'll submit a patch after I let it soak for a couple of days.
Sam, whenever you have a "cpdef" or "cdef" function that returns a non-python value, you need to explicitly tell Cython what return value means "exception" (or "except *" to mean always check).
I assume you're talking about getbyte()... looks a little tricky, actually, since there are no 'invalid' characters in a dns packet. How about this, have it return an 'int', declare it as "except -1"?
I saw a python.core today that came from packet.pyx. I couldn't get gdb to load the symbols properly but from the traceback it seems that it received an empty response and we proceeded to unpack it. The daemon has been running for a month or so now and that's the first time I see this issue.
https://github.com/ironport/shrapnel/blob/master/coro/dns/stub_resolver.py#L43
I added a check to make sure that the reply is not empty before we pass it to unpacker. I'll see if it happens again.
I can provide the python core if anyone is interested in it.