diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 756dce48db..27f14e9549 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -8720,8 +8720,8 @@ static char *get_header_by_tag(char *header, char *tag) ast_mutex_lock(&imaptemp_lock); ast_copy_string(imaptemp, start+taglen, sizeof(imaptemp)); ast_mutex_unlock(&imaptemp_lock); - eol_pnt = strchr(imaptemp,'\n'); - *eol_pnt = '\0'; + if ((eol_pnt = strchr(imaptemp,'\r')) || (eol_pnt = strchr(imaptemp,'\n'))) + *eol_pnt = '\0'; return imaptemp; }