summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/error.c b/error.c
index 834eede8af..646fb16232 100644
--- a/error.c
+++ b/error.c
@@ -251,9 +251,10 @@ rb_warn_m(int argc, VALUE *argv, VALUE exc)
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
- char buf[BUFSIZ];
+ /* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
+ char buf[256];
FILE *out = stderr;
- int len = err_position_0(buf, BUFSIZ, file, line);
+ int len = err_position_0(buf, 256, file, line);
if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {