[PATCH] Sanitize printf functions
Evgeniy Stepanov
eugenis at google.com
Fri Jan 10 05:07:00 PST 2014
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc:204
@@ +203,3 @@
+ p = maybe_parse_param_index(p, &dir->argIdx);
+ if (!p)
+ return 0;
----------------
It never returns null pointer.
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc:212
@@ -77,1 +211,3 @@
// Field width.
+ if (*p == '-')
+ ++p;
----------------
maybe_parse_signed ?
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc:420
@@ +419,3 @@
+ // Length modifier.
+ if (char_is_one_of(*p, "jztLq")) {
+ dir->lengthModifier[0] = *p;
----------------
Code duplication between scanf and printf parsers. Please factor this out.
http://llvm-reviews.chandlerc.com/D2480
More information about the llvm-commits
mailing list