[Home]

Summary:ASTERISK-15181: app_voicemail.c strip_control() strips more than just control chars
Reporter:Walter Doekes (wdoekes)Labels:
Date Opened:2009-11-20 05:25:57.000-0600Date Closed:2009-12-04 11:47:17.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In app_voicemail.c in the function strip_control, the following check is done:

static char *strip_control(const char *input, char *buf, size_t buflen)
{
       char *bufptr = buf;
       for (; *input; input++) {
               if (*input < 32) {
                       continue;

On many platforms, char is signed by default.
This way not only control characters, but also all characters above 127 are filtered as well.

This could be considered intended behaviour to make sure the Subject and X-headers get 7-bit clean data, but as there also is a ast_str_encode_mime to encode >127 chars according to a selected character set, it looks more like a bug.

Suggested fix:
- Either rename strip_control to strip_control_and_high,
- Or cast (*input) to (unsigned char) in the comparison and add ast_str_encode_mime calls to the X-headers where enc_cidnum and enc_cidname are used.


Regards,
Walter Doekes
OSSO B.V.
Comments:By: Digium Subversion (svnbot) 2009-12-04 11:29:21.000-0600

Repository: asterisk
Revision: 233116

U   branches/1.4/apps/app_voicemail.c

------------------------------------------------------------------------
r233116 | dvossel | 2009-12-04 11:29:21 -0600 (Fri, 04 Dec 2009) | 6 lines

document and rename strip_control() in app_voicemail

(closes issue ASTERISK-15181)
Reported by: wdoekes


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=233116

By: Digium Subversion (svnbot) 2009-12-04 11:30:16.000-0600

Repository: asterisk
Revision: 233121

_U  trunk/
U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r233121 | dvossel | 2009-12-04 11:30:16 -0600 (Fri, 04 Dec 2009) | 12 lines

Merged revisions 233116 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r233116 | dvossel | 2009-12-04 11:21:34 -0600 (Fri, 04 Dec 2009) | 6 lines
 
 document and rename strip_control() in app_voicemail
 
 (closes issue ASTERISK-15181)
 Reported by: wdoekes
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=233121

By: Digium Subversion (svnbot) 2009-12-04 11:44:06.000-0600

Repository: asterisk
Revision: 233165

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_voicemail.c

------------------------------------------------------------------------
r233165 | dvossel | 2009-12-04 11:44:05 -0600 (Fri, 04 Dec 2009) | 19 lines

Merged revisions 233121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r233121 | dvossel | 2009-12-04 11:22:31 -0600 (Fri, 04 Dec 2009) | 12 lines
 
 Merged revisions 233116 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r233116 | dvossel | 2009-12-04 11:21:34 -0600 (Fri, 04 Dec 2009) | 6 lines
   
   document and rename strip_control() in app_voicemail
   
   (closes issue ASTERISK-15181)
   Reported by: wdoekes
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=233165

By: Digium Subversion (svnbot) 2009-12-04 11:45:00.000-0600

Repository: asterisk
Revision: 233166

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_voicemail.c

------------------------------------------------------------------------
r233166 | dvossel | 2009-12-04 11:44:59 -0600 (Fri, 04 Dec 2009) | 19 lines

Merged revisions 233121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r233121 | dvossel | 2009-12-04 11:22:31 -0600 (Fri, 04 Dec 2009) | 12 lines
 
 Merged revisions 233116 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r233116 | dvossel | 2009-12-04 11:21:34 -0600 (Fri, 04 Dec 2009) | 6 lines
   
   document and rename strip_control() in app_voicemail
   
   (closes issue ASTERISK-15181)
   Reported by: wdoekes
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=233166

By: Digium Subversion (svnbot) 2009-12-04 11:47:17.000-0600

Repository: asterisk
Revision: 233167

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_voicemail.c

------------------------------------------------------------------------
r233167 | dvossel | 2009-12-04 11:47:16 -0600 (Fri, 04 Dec 2009) | 19 lines

Merged revisions 233121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r233121 | dvossel | 2009-12-04 11:22:31 -0600 (Fri, 04 Dec 2009) | 12 lines
 
 Merged revisions 233116 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r233116 | dvossel | 2009-12-04 11:21:34 -0600 (Fri, 04 Dec 2009) | 6 lines
   
   document and rename strip_control() in app_voicemail
   
   (closes issue ASTERISK-15181)
   Reported by: wdoekes
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=233167