--- parser3/src/main/untaint.C 2001/04/05 13:27:14 1.35 +++ parser3/src/main/untaint.C 2001/04/09 11:04:12 1.37 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: untaint.C,v 1.35 2001/04/05 13:27:14 paf Exp $ + $Id: untaint.C,v 1.37 2001/04/09 11:04:12 paf Exp $ */ #include "pa_config_includes.h" @@ -47,7 +47,7 @@ inline bool need_file_encode(unsigned ch return !strchr( #ifdef WIN32 - ":\\" + ":\\~" #endif "./", c); } @@ -57,7 +57,7 @@ inline bool need_uri_encode(unsigned cha return !strchr("_-./", c); } -inline bool need_header_encode(unsigned char c){ +inline bool need_http_header_encode(unsigned char c){ if(strchr(" , :", c)) return false; @@ -80,6 +80,7 @@ static bool typo_present(Array::Item *va /** @test optimize whitespaces for all but 'html' @todo fix theoretical \n mem overrun in TYPO replacements + @test mail-header */ char *String::store_to(char *dest, Untaint_lang lang, SQL_Connection *connection) const { // $MAIN:html-typo table @@ -121,12 +122,17 @@ char *String::store_to(char *dest, Untai encode(need_uri_encode, '%'); }); break; - case UL_HEADER: - // tainted, untaint language: header + case UL_HTTP_HEADER: + // tainted, untaint language: http-header escape(switch(*src) { - encode(need_header_encode, '%'); + encode(need_http_header_encode, '%'); }); break; + case UL_MAIL_HEADER: + // tainted, untaint language: mail-header + memcpy(dest, row->item.ptr, row->item.size); + dest+=row->item.size; + break; case UL_TABLE: // tainted, untaint language: table escape(switch(*src) {