asterisk-11.x: add upstream patches for CVEs
[feed/telephony.git] / net / asterisk-11.x / patches / 023-AST-2016-009-11.diff
1 diff --git a/channels/chan_sip.c b/channels/chan_sip.c
2 index 556db57..9c74acb 100644
3 --- a/channels/chan_sip.c
4 +++ b/channels/chan_sip.c
5 @@ -8132,8 +8132,6 @@ static const char *__get_header(const struct sip_request *req, const char *name,
6 * one afterwards. If you shouldn't do it, what absolute idiot decided it was
7 * a good idea to say you can do it, and if you can do it, why in the hell would.
8 * you say you shouldn't.
9 - * Anyways, pedanticsipchecking controls whether we allow spaces before ':',
10 - * and we always allow spaces after that for compatibility.
11 */
12 const char *sname = find_alias(name, NULL);
13 int x, len = strlen(name), slen = (sname ? 1 : 0);
14 @@ -8146,10 +8144,10 @@ static const char *__get_header(const struct sip_request *req, const char *name,
15 if (match || smatch) {
16 /* skip name */
17 const char *r = header + (match ? len : slen );
18 - if (sip_cfg.pedanticsipchecking) {
19 - r = ast_skip_blanks(r);
20 + /* HCOLON has optional SP/HTAB; skip past those */
21 + while (*r == ' ' || *r == '\t') {
22 + ++r;
23 }
24 -
25 if (*r == ':') {
26 *start = x+1;
27 return ast_skip_blanks(r+1);