Convert the character pointers in a sip_request to be pointer offsets
authorMark Michelson <mmichelson@digium.com>
Tue, 20 Jan 2009 20:10:31 +0000 (20:10 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 20 Jan 2009 20:10:31 +0000 (20:10 +0000)
commit419bb42e04fe1b29155531947e68b8994400051a
tree6105d7140383982f6f07e50dbe58137ecb1002eb
parent01b95990b0764b3184ec61c706e822165b625025
Convert the character pointers in a sip_request to be pointer offsets

When an ast_str expands to hold more data, any pointers that were pointing
to the data prior to the expansion will be pointing at invalid memory. This
change makes such pointers used in chan_sip.c instead be offsets from the
beginning of the string so that the same math may be applied no matter where
in memory the string resides.

To help ease this transition, a macro called REQ_OFFSET_TO_STR has been added
to chan_sip.c so that given a sip_request and an offset, the string at that
offset is returned.

(closes issue #14220)
Reported by: riksta
Tested by: putnopvut

Review http://reviewboard.digium.com/r/126/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c