--- parser3/src/main/pa_string.C 2026/11/03 14:16:14 1.290 +++ parser3/src/main/pa_string.C 2026/11/29 13:17:21 1.291 @@ -12,7 +12,7 @@ #include "pa_charset.h" #include "pa_vregex.h" -volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.290 2026/11/03 14:16:14 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.291 2026/11/29 13:17:21 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -836,10 +836,10 @@ bool String::deserialize(size_t prolog_s memcpy(&body_length, cur, sizeof(body_length)); cur+=sizeof(body_length); in_buf-=sizeof(body_length); - if(in_bufbody_length) + if(!fragment_length || fragment_length>body_length-total_length /* the sum can overflow */ || !lang /* CORD_chars(0) is shorter */) return false; // file curruption // uchar needed to prevent propagating 0x80 bit to upper bytes langs.append(total_length, (String::Language)(uchar)lang, fragment_length); @@ -880,7 +880,8 @@ bool String::deserialize(size_t prolog_s if(total_length!=body_length) // length(all language fragments) vs length(letters) return false; - } + } else if(body_length) // letters without languages + return false; if(in_buf!=0) // some strange extra bytes return false;