[Bug translator/7000] printf %n specifier causes segfault
wenji dot huang at oracle dot com
sourceware-bugzilla@sourceware.org
Thu Nov 13 08:56:00 GMT 2008
------- Additional Comments From wenji dot huang at oracle dot com 2008-11-13 08:54 -------
Lack of checking bound in c_unparser::visit_print_format will cause the segment
fault. Seems this patch can avoid that.
diff --git a/translate.cxx b/translate.cxx
index 4112855..741455e 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4199,7 +4199,7 @@ c_unparser::visit_print_format (print_format* e)
/* The type of the %c argument is 'int'. */
else if (components[i].type == print_format::conv_char)
o->line() << ", (int)" << tmp[arg_ix++].value();
- else
+ else if (arg_ix < (int) tmp.size())
o->line() << ", " << tmp[arg_ix++].value();
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=7000
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Systemtap
mailing list