From: Victor Wagner Date: Tue, 18 Jul 2006 11:09:44 +0000 (+0000) Subject: Fixed buffer overflow on very-very long RTF paragraphs. X-Git-Tag: REL_0_95~25 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=0b4d0a1e010cf93c4b9311c9ebf27c91bc2714cc;p=oss%2Fcatdoc.git Fixed buffer overflow on very-very long RTF paragraphs. --- diff --git a/src/rtfread.c b/src/rtfread.c index 902ee77..8ed1be6 100644 --- a/src/rtfread.c +++ b/src/rtfread.c @@ -171,7 +171,7 @@ int rtf_level=0; extern unsigned short int buffer[]; void add_to_buffer(int *bufptr,unsigned short int c) { buffer[++(*bufptr)]=c; - if (*bufptr > PARAGRAPH_BUFFER-2) { + if (*bufptr >= PARAGRAPH_BUFFER-2) { buffer[++(*bufptr)]=0; output_paragraph(buffer); *bufptr=-1;