aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-18 17:59:35 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-18 17:59:35 +0000
commita618e583f2d95f5478636009086b56faa96cd81c (patch)
tree5ccfc08dac795a01005a89b731ab076031e1185d /channels
parent1e88e69a0c56979e7047cd3fb4dc39f1ccb25193 (diff)
fix bug 7450 - Parsing fails if From header contains angle brackets
(the bug was only in a corner case where the < was right after the opening quote, and the fix is trivial). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47823 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 74e319919..a81fbb7ab 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8748,11 +8748,12 @@ static char *get_calleridname(const char *input, char *output, size_t outputsize
if (!end || end == input) /* we require a part in brackets */
return NULL;
- /* move away from "<" */
- end--;
+ end--; /* move just before "<" */
- /* we found "name" */
- if (tmp && tmp < end) {
+ if (tmp && tmp <= end) {
+ /* The quote (tmp) precedes the bracket (end+1).
+ * Find the matching quote and return the content.
+ */
end = strchr(tmp+1, '"');
if (!end)
return NULL;
@@ -8762,7 +8763,7 @@ static char *get_calleridname(const char *input, char *output, size_t outputsize
bytes = maxbytes;
ast_copy_string(output, tmp + 1, bytes);
} else {
- /* we didn't find "name" */
+ /* No quoted string, or it is inside brackets. */
/* clear the empty characters in the begining*/
input = ast_skip_blanks(input);
/* clear the empty characters in the end */