summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fuzz/host_command_fuzz.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fuzz/host_command_fuzz.c b/fuzz/host_command_fuzz.c
index 5d490bc192..381e7686c3 100644
--- a/fuzz/host_command_fuzz.c
+++ b/fuzz/host_command_fuzz.c
@@ -56,6 +56,9 @@ struct chunk {
static int hostcmd_fill(const uint8_t *data, size_t size)
{
static int first = 1;
+ int ipos = 0;
+ int i;
+ int req_size = 0;
#ifdef VALID_REQUEST_ONLY
const int checksum_offset = offsetof(struct ec_host_request, checksum);
@@ -75,10 +78,6 @@ static int hostcmd_fill(const uint8_t *data, size_t size)
struct chunk chunks[1] = { {0, sizeof(req_buf)} };
#endif
- int ipos = 0;
- int i;
- int req_size = 0;
-
/*
* TODO(chromium:854975): We should probably malloc req_buf with the
* correct size, to make we do not read uninitialized req_buf data.