aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-12-20 12:36:59 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-12-20 16:45:33 +0100
commit5655dc58a995a043316c35b1114f84bdbf3da78c (patch)
tree3d1e956ac1ccec28ec84768098e846376b0f3056 /pkg
parent08f0467614312b8c91ee8a76f8a0f349b797e7eb (diff)
executor: make syz_compare output more handy to use
Diffstat (limited to 'pkg')
-rw-r--r--pkg/csource/generated.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 6a360746c..074b7bcb0 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -6026,20 +6026,21 @@ static long syz_exit(volatile long status)
static long syz_compare(volatile long want, volatile long want_len, volatile long got, volatile long got_len)
{
if (want_len != got_len) {
- debug("syz_compare: want_len=%lu got_len=%lu data:\n", want_len, got_len);
- debug_dump_data((char*)got, got_len);
errno = EBADF;
- return -1;
+ goto error;
}
if (memcmp((void*)want, (void*)got, want_len)) {
- debug("syz_compare: data differs, want:\n");
- debug_dump_data((char*)want, want_len);
- debug("got:\n");
- debug_dump_data((char*)got, got_len);
errno = EINVAL;
- return -1;
+ goto error;
}
return 0;
+
+error:
+ debug("syz_compare: want (%lu):\n", want_len);
+ debug_dump_data((char*)want, want_len);
+ debug("got (%lu):\n", got_len);
+ debug_dump_data((char*)got, got_len);
+ return -1;
}
#endif