summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/error.c b/error.c
index 7befc7b8ee..e0c91f6746 100644
--- a/error.c
+++ b/error.c
@@ -595,6 +595,7 @@ rb_raise(exc, fmt, va_alist)
va_init_list(args,fmt);
vsnprintf(buf, BUFSIZ, fmt, args);
+ buf[BUFSIZ - 1] = '\0';
va_end(args);
rb_exc_raise(rb_exc_new2(exc, buf));
}