--- parser3/src/main/pa_string.C 2005/05/24 10:56:57 1.202 +++ parser3/src/main/pa_string.C 2006/03/04 18:02:40 1.206 @@ -1,11 +1,11 @@ /** @file Parser: string class. @see untalength_t.C. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_STRING_C="$Date: 2005/05/24 10:56:57 $"; +static const char * const IDENT_STRING_C="$Date: 2006/03/04 18:02:40 $"; #include "pcre.h" @@ -104,7 +104,7 @@ double pa_atod(const char* str, const St #ifndef DOXYGEN typedef struct { ssize_t countdown; - char target; /* Character we're looking for */ + int target; /* Character we're looking for */ } chr_data; #endif static int CORD_range_contains_chr_greater_then_proc(char c, size_t size, void* client_data) @@ -406,7 +406,7 @@ Table* String::match(Charset& source_cha 0, "regexp is empty"); - const char* pattern=regexp.cstr(); + const char* pattern=regexp.cstr(String::L_UNSPECIFIED); // fix any tainted with L_REGEX const char* errptr; int erroffset; bool need_pre_post_match=false; @@ -685,9 +685,12 @@ bool String::deserialize(size_t prolog_s // length [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(&fragment_length, cur, sizeof(fragment_length)); cur+=sizeof(fragment_length); + size_t combined_length=total_length+fragment_length; + if(combined_length>body_length) + return false; // file curruption // uchar needed to prevent propagating 0x80 bit to upper bytes langs.append(total_length, (String::Language)(uchar)lang, fragment_length); - total_length+=fragment_length; + total_length=combined_length; in_buf-=piece_length; }