rolled back to 2.9.2 because 2.9.4 doesn't work with XML validator
[platform/upstream/libxml2.git] / buf.c
diff --git a/buf.c b/buf.c
index 07922ff..6efc7b6 100644 (file)
--- a/buf.c
+++ b/buf.c
@@ -27,7 +27,6 @@
 #include <libxml/tree.h>
 #include <libxml/globals.h>
 #include <libxml/tree.h>
-#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */
 #include "buf.h"
 
 #define WITH_BUFFER_COMPAT
@@ -300,8 +299,7 @@ xmlBufSetAllocationScheme(xmlBufPtr buf,
     if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
         (scheme == XML_BUFFER_ALLOC_EXACT) ||
         (scheme == XML_BUFFER_ALLOC_HYBRID) ||
-        (scheme == XML_BUFFER_ALLOC_IMMUTABLE) ||
-       (scheme == XML_BUFFER_ALLOC_BOUNDED)) {
+        (scheme == XML_BUFFER_ALLOC_IMMUTABLE)) {
        buf->alloc = scheme;
         if (buf->buffer)
             buf->buffer->alloc = scheme;
@@ -460,18 +458,6 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
     size = buf->use + len + 100;
 #endif
 
-    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-        /*
-        * Used to provide parsing limits
-        */
-        if ((buf->use + len >= XML_MAX_TEXT_LENGTH) ||
-           (buf->size >= XML_MAX_TEXT_LENGTH)) {
-           xmlBufMemoryError(buf, "buffer error: text too long\n");
-           return(0);
-       }
-       if (size >= XML_MAX_TEXT_LENGTH)
-           size = XML_MAX_TEXT_LENGTH;
-    }
     if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
         size_t start_buf = buf->content - buf->contentIO;
 
@@ -753,15 +739,6 @@ xmlBufResize(xmlBufPtr buf, size_t size)
     CHECK_COMPAT(buf)
 
     if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
-    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-        /*
-        * Used to provide parsing limits
-        */
-        if (size >= XML_MAX_TEXT_LENGTH) {
-           xmlBufMemoryError(buf, "buffer error: text too long\n");
-           return(0);
-       }
-    }
 
     /* Don't resize if we don't have to */
     if (size < buf->size)
@@ -890,15 +867,6 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) {
 
     needSize = buf->use + len + 2;
     if (needSize > buf->size){
-       if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-           /*
-            * Used to provide parsing limits
-            */
-           if (needSize >= XML_MAX_TEXT_LENGTH) {
-               xmlBufMemoryError(buf, "buffer error: text too long\n");
-               return(-1);
-           }
-       }
         if (!xmlBufResize(buf, needSize)){
            xmlBufMemoryError(buf, "growing buffer");
             return XML_ERR_NO_MEMORY;
@@ -970,15 +938,6 @@ xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) {
     }
     needSize = buf->use + len + 2;
     if (needSize > buf->size){
-       if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-           /*
-            * Used to provide parsing limits
-            */
-           if (needSize >= XML_MAX_TEXT_LENGTH) {
-               xmlBufMemoryError(buf, "buffer error: text too long\n");
-               return(-1);
-           }
-       }
         if (!xmlBufResize(buf, needSize)){
            xmlBufMemoryError(buf, "growing buffer");
             return XML_ERR_NO_MEMORY;