diff options
author | Kostya Serebryany <kcc@google.com> | 2016-01-12 00:43:42 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-01-12 00:43:42 +0000 |
commit | 74d2d9fb71d7b3d594e78289383fc4bc4dc4e08e (patch) | |
tree | 20c617b6f3c2ae38b11045e83c64f1298d76e80f /include/sanitizer | |
parent | bef0958bac79738acf4a2f1f52a7ae966967a3b2 (diff) |
[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive the result of the computations. With that, don't do any mutations if memcmp/etc returned 0
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/sanitizer')
-rw-r--r-- | include/sanitizer/common_interface_defs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h index b736ed9e5..b2a4bb7b8 100644 --- a/include/sanitizer/common_interface_defs.h +++ b/include/sanitizer/common_interface_defs.h @@ -125,9 +125,11 @@ extern "C" { // to know what is being passed to libc functions, e.g. memcmp. // FIXME: implement more hooks. void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1, - const void *s2, size_t n); + const void *s2, size_t n, int result); void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1, - const char *s2, size_t n); + const char *s2, size_t n, int result); + void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1, + const char *s2, int result); #ifdef __cplusplus } // extern "C" #endif |