diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-12-26 09:39:22 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-12-27 09:18:26 +0100 |
| commit | b7b7ac19fd9e2afbf5aea4db5e3f318576e6809f (patch) | |
| tree | c43e8bbb312fc42016cd75526301ac9842ae70c9 /executor/executor_linux.cc | |
| parent | 6f03c356200becfa347b8abade66ac74f52c10c9 (diff) | |
executor: check format strings
I see a crash which says:
#0: too much cover 0 (errno 0)
while the code is:
uint64_t n = ...;
if (n >= kCoverSize)
fail("#%d: too much cover %u", th->id, n);
It seems that the high part of n is set, but we don't see it.
Add printf format attribute to fail and friends and fix all similar cases.
Caught a bunch of similar cases and a missing argument in:
exitf("opendir(%s) failed due to NOFILE, exiting");
Diffstat (limited to 'executor/executor_linux.cc')
| -rw-r--r-- | executor/executor_linux.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/executor/executor_linux.cc b/executor/executor_linux.cc index 38ecf42f5..d66be92d2 100644 --- a/executor/executor_linux.cc +++ b/executor/executor_linux.cc @@ -262,9 +262,9 @@ uint64_t read_cover_size(thread_t* th) if (!flag_cover) return 0; uint64_t n = __atomic_load_n(th->cover_size_ptr, __ATOMIC_RELAXED); - debug("#%d: read cover size = %u\n", th->id, n); + debug("#%d: read cover size = %llu\n", th->id, n); if (n >= kCoverSize) - fail("#%d: too much cover %u", th->id, n); + fail("#%d: too much cover %llu", th->id, n); return n; } |
