Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 36289) +++ channels/chan_sip.c (working copy) @@ -8451,6 +8451,7 @@ { const char *end = strchr(input,'<'); /* first_bracket */ const char *tmp = strchr(input,'"'); /* first quote */ + char last_ch; int bytes = 0; int maxbytes = outputsize - 1; @@ -8461,9 +8462,16 @@ end--; /* we found "name" */ - if (tmp && tmp < end) { - end = strchr(tmp+1, '"'); - if (!end) + if (tmp && tmp <= end) { + end = tmp + 1; + last_ch = '\0'; + for (last_ch = '\0', end = tmp + 1; *end != '\0'; end++) { + if (*end == '"' && last_ch != '\\') + break; + last_ch = *end; + } + + if (*end == '\0') return NULL; bytes = (int) (end - tmp); /* protect the output buffer */