summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a6754b6..629f809 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -42,7 +42,12 @@ void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size) {
if (target_size < buf->asize)
return;
- if (target_size > (bufsize_t)(INT32_MAX / 2))
+ if (target_size > (bufsize_t)(INT32_MAX / 2)) {
+ fprintf(stderr,
+ "[cmark] cmark_strbuf_grow requests buffer with size > %d, aborting\n",
+ (bufsize_t)(INT32_MAX / 2));
+ abort();
+ }
abort();
/* Oversize the buffer by 50% to guarantee amortized linear time