systemtap/systemtap-parameter-bound-check.diff

12 lines
451 B
Diff
Raw Normal View History

--- translate.cxx-dist 2008-09-06 16:27:03.000000000 +0200
+++ translate.cxx 2008-11-21 14:19:52.000000000 +0100
@@ -4193,7 +4193,7 @@ c_unparser::visit_print_format (print_fo
/* The type of the %m argument is 'char*'. */
if (components[i].type == print_format::conv_memory)
o->line() << ", (char*)(uintptr_t)" << tmp[arg_ix++].value();
- else
+ else if (arg_ix < (int) tmp.size())
o->line() << ", " << tmp[arg_ix++].value();
}