From b7b7ac19fd9e2afbf5aea4db5e3f318576e6809f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Dec 2017 09:39:22 +0100 Subject: 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"); --- pkg/csource/csource.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/csource/csource.go') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 14f381451..13377c57e 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -143,6 +143,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { out0 = re.ReplaceAllString(out0, "") } out0 = strings.Replace(out0, "NORETURN", "", -1) + out0 = strings.Replace(out0, "PRINTF", "", -1) // Remove duplicate new lines. out1 := []byte(out0) -- cgit mrf-deployment