This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/7000] printf %n specifier causes segfault
- From: "wenji dot huang at oracle dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 13 Nov 2008 08:54:53 -0000
- Subject: [Bug translator/7000] printf %n specifier causes segfault
- References: <20081031210840.7000.ebaron@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.