summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 20:37:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 20:37:15 +0000
commitd068ac8e0c2efad8230bedc57ceddf2d413231d6 (patch)
tree3468ca5e7f01b6b5b0963ceb8cf387ff7d64677d /error.c
parent2646c694794888572d4f9e903f4b148628e7ec3d (diff)
* error.c (report_bug): use buf and snprintf to avoid consuming stack.
[ruby-dev:45272] [Bug #6058] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/error.c b/error.c
index c212c53b3f..bea4d50909 100644
--- a/error.c
+++ b/error.c
@@ -260,8 +260,11 @@ report_bug(const char *file, int line, const char *fmt, va_list args)
(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
fputs("[BUG] ", out);
- vfprintf(out, fmt, args);
- fprintf(out, "\n%s\n\n", ruby_description);
+ vsnprintf(buf, 256, fmt, args);
+ fputs(buf, out);
+ snprintf(buf, 256, "\n%s\n\n", ruby_description);
+ fputs(buf, out);
+
rb_vm_bugreport();