]> www.wagner.pp.ru Git - oss/catdoc.git/commitdiff
Fixed buffer overflow on very-very long RTF paragraphs.
authorVictor Wagner <vitus@wagner.pp.ru>
Tue, 18 Jul 2006 11:09:44 +0000 (11:09 +0000)
committerVictor Wagner <vitus@wagner.pp.ru>
Tue, 18 Jul 2006 11:09:44 +0000 (11:09 +0000)
src/rtfread.c

index 902ee771e1138e7e68904280f3faa6d01006a08a..8ed1be68c78bf0634c2690241bc7886772d35c74 100644 (file)
@@ -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;