diff options
author | Vicent Marti <tanoku@gmail.com> | 2016-05-24 15:50:44 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-06-06 15:39:05 -0700 |
commit | 42b07cc9c8d2e6251d190e5ea0d13fd66cb51e6d (patch) | |
tree | 493ffc6b16278c54da28645d96a9359717625576 /src/buffer.h | |
parent | 0eafc0af940646ab581e47e63090c1692a3525aa (diff) |
cmake: Global handler for OOM situations
Diffstat (limited to 'src/buffer.h')
-rw-r--r-- | src/buffer.h | 18 |
1 files changed, 1 insertions, 17 deletions
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); |