[PATCH] [sanitizer] Improve scanf interceptor

Evgeniy Stepanov eugenis at google.com
Thu Feb 7 06:17:56 PST 2013


Hi kcc, samsonov,

This a rewrite of the scanf parser. The new implementation is pretty close to the spec, with a few shortcuts taken here and there. It is conservative, i.e. it gives up parsing if it does not understand some part of the format string, or runs into an ambiguous % spec. It does not handle some rarely used parts of the spec, like %n$ - for now.

I'm also moving parser call to after the original *scanf function completes, so that we can find out the store size of %s directive by the use of strlen() on the target buffer.

http://llvm-reviews.chandlerc.com/D381

Files:
  sanitizer_common_interceptors.inc
  tests/sanitizer_scanf_interceptor_test.cc
  sanitizer_common_interceptors_scanf.inc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D381.1.patch
Type: text/x-patch
Size: 13787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130207/a2e24e18/attachment.bin>


More information about the llvm-commits mailing list