diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c index 6c7031730e..37d77d418f 100644 --- a/channels/sip/reqresp_parser.c +++ b/channels/sip/reqresp_parser.c @@ -1029,14 +1029,14 @@ int get_in_brackets_full(char *tmp,char **out,char **residue) only affects token based display-names there is no danger of brackets being in quotes */ if (first_bracket) { parse = first_bracket; - } else { + } else { parse = tmp; } if ((second_bracket = strchr(parse, '>'))) { *second_bracket++ = '\0'; if (out) { - *out = first_bracket; + *out = (char *) parse; } if (residue) { *residue = second_bracket; @@ -1045,9 +1045,9 @@ int get_in_brackets_full(char *tmp,char **out,char **residue) } if ((first_bracket)) { - ast_log(LOG_WARNING, "No closing bracket found in '%s'\n", tmp); + ast_log(LOG_WARNING, "No closing bracket found in '%s'\n", tmp); return -1; - } + } if (out) { *out = tmp; @@ -1076,6 +1076,7 @@ AST_TEST_DEFINE(get_in_brackets_test) char name_no_quotes[] = "name not in quotes "; char no_end_bracket[] = "name not in quotes