From 42b07cc9c8d2e6251d190e5ea0d13fd66cb51e6d Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Tue, 24 May 2016 15:50:44 +0200 Subject: cmake: Global handler for OOM situations --- src/buffer.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/buffer.h') diff --git a/src/buffer.h b/src/buffer.h index ad4f341..93ffc95 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -25,22 +25,6 @@ extern unsigned char cmark_strbuf__initbuf[]; #define GH_BUF_INIT \ { cmark_strbuf__initbuf, 0, 0 } -/* - * Maximum size for memory storage on any given `cmark_strbuf` object. - * - * This is a "safe" value to prevent unbounded memory growth when - * parsing arbitrarily large (and potentially malicious) documents. - * - * It is currently set to 32mb, which is a reasonable default for - * production applications. If you need to parse documents larger than - * that, you can increase this value up to `SSIZE_MAX / 2` (which in - * practice resolves to 1/4th of the total address space for the program). - * - * Anything larger than that is a security threat and hence static checks - * will prevent CMark from compiling. - */ -#define BUFSIZE_MAX (32 * 1024 * 1024) - /** * Initialize a cmark_strbuf structure. * @@ -52,7 +36,7 @@ void cmark_strbuf_init(cmark_strbuf *buf, bufsize_t initial_size); /** * Grow the buffer to hold at least `target_size` bytes. */ -bool cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size); +void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size); void cmark_strbuf_free(cmark_strbuf *buf); void cmark_strbuf_swap(cmark_strbuf *buf_a, cmark_strbuf *buf_b); -- cgit v1.2.3