Fix Record-Route parsing for large headers.
authorDavid M. Lee <dlee@digium.com>
Fri, 18 Jan 2013 05:31:23 +0000 (05:31 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 18 Jan 2013 05:31:23 +0000 (05:31 +0000)
commitbe727bf0d217ae086f5df3f1a3e3338be7c71a48
tree8396e3281f45a8830b372dc37032938d0b03e8ec
parentea78b7cbc8e8806f1d55ba30726a8588391ffb00
Fix Record-Route parsing for large headers.

Record-Route parsing copied the header into a char[256] array, which can
be a problem if the header is longer than that. This patch parses the
header in place, without the copy, avoiding the issue.

In addition to the original patch, I added a unit test for the new
get_in_brackets_const function.

(closes issue ASTERISK-20837)
Reported by: Corey Farrell
Patches:
chan_sip-build_route-optimized-rev1.patch uploaded by Corey Farrell (license 5909)
(with minor changes by dlee)
........

Merged revisions 379392 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 379393 from http://svn.asterisk.org/svn/asterisk/branches/11

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