[OpenSIPS-Users] Parsing invalid Content-Length header, try to change it to a valid one

joel.oliveira joel.oliveira at interacesso.pt
Mon Jun 13 20:27:24 CEST 2011


This was the answer on the #opensips IRC channel from the user lirakis:

<lirakis>	joel_oliveira, to the best of my knowledge, opensips maintains a
struct for the received sip packet that is not modifyable
<lirakis>	you can get data out of it and do transforms etc. and set headers
on the outbound packet, but there is no "preprocessing" that can be done to
the received packet before opensips parses it.
<joel_oliveira>	lirakis: yes, it looks that way. It seems to me that if I
want to do some change to the behaviour of OpenSIPs regarding this kind of
parsing in particular, I have to change the parse_content_length function
itself, no?
<lirakis>	... well .. i suppose you could - but I wouldnt do that unless it
is "okay" by the RFC to have a space in the content length
<lirakis>	my guess is that it is not okay
<lirakis>	and thus - you want to reject the header or packet entirely as
being malformed
<lirakis>	i just checked the rfc ABNF, space is not allowed
<joel_oliveira>	lirakis: you're right. I should just plain reject it right
in the first Invite.
<lirakis>	yeah i mean if you pass it through .. its going to induce unknown
behavior in whoever has to handle the packet next - so better to drop it on
first detection
<joel_oliveira>	lirakis: thanks for your time. You did enlighten me
<lirakis>	np

I guess I'll drop my option since is not RFC complaint. Thanks.

Best Regards,
Joel Oliveira

--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Parsing-invalid-Content-Length-header-try-to-change-it-to-a-valid-one-tp6470966p6471245.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list