Skip to content

Commit

Permalink
Force case insensitive matching via fnmatch
Browse files Browse the repository at this point in the history
remove_hf(,'g') uses fnmatch with FNM_CASEFOLD if available (as it is a GNU extension)
Closes #1333
Reported by Nick Altmann

(cherry picked from commit 19a8691)
  • Loading branch information
bogdan-iancu committed Apr 5, 2018
1 parent a0a1553 commit 3f952c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/sipmsgops/sipmsgops.c
Expand Up @@ -520,7 +520,11 @@ static int remove_hf_match_f(struct sip_msg* msg, char* pattern, char* regex_or_
tmp = *(hf->name.s+hf->name.len);
*(hf->name.s+hf->name.len) = 0;
if( matchtype == 'g' ) { /* GLOB */
#ifdef FNM_CASEFOLD
if(fnmatch(pat->s, hf->name.s, FNM_CASEFOLD) !=0 ){
#else
if(fnmatch(pat->s, hf->name.s, 0) !=0 ){
#endif
*(hf->name.s+hf->name.len) = tmp;
continue;
}
Expand Down

0 comments on commit 3f952c2

Please sign in to comment.