noxxi / p5-net-sip

Net::SIP Perl Module
Other
15 stars 22 forks source link

Do not crash when received malformed SDP packet #42

Closed pali closed 3 years ago

pali commented 3 years ago

Net::SIP::SDP->new() can die in case supplied body is malformed. Net::SIP::Packet's sdp_body() method is called for every received SDP packet with packet content. So put Net::SIP::SDP->new() call into eval block to prevent Net::SIP crashing.

noxxi commented 3 years ago

Looks good. Thanks.

noxxi commented 3 years ago

I've reverted the change with the release of 0.829. The behavior of propagating the error with a die instead of hiding it (i.e. no SDP body is the same as corrupt) is actually documented and the code is supposed to handle this. Most of the code in Net::SIP did this already and I've now fixed the one remaining place. There is also external code which relies on this behavior to detect invalid SDP payloads and then treat them as invalid instead of non-existing.

pali commented 3 years ago

I've now fixed the one remaining place.

Ok! If this prevents crashing Net::SIP then fine for me.