aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-05-04 14:20:59 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-05-05 14:29:16 +0200
commit4149cebd64a916e934a1485b75f464e26c9bf4ea (patch)
tree962c6aac873099c2ecc4ee9ae93b032d4a91a960 /tests
parent425c02cb9437f87daa817e3b62c4a3f5226daf37 (diff)
downloadlibssh-4149cebd64a916e934a1485b75f464e26c9bf4ea.tar.gz
libssh-4149cebd64a916e934a1485b75f464e26c9bf4ea.tar.xz
libssh-4149cebd64a916e934a1485b75f464e26c9bf4ea.zip
fuzz: Avoid warnings from csbuild in fuzzers
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/fuzz/ssh_client_fuzzer.cpp4
-rw-r--r--tests/fuzz/ssh_server_fuzzer.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/fuzz/ssh_client_fuzzer.cpp b/tests/fuzz/ssh_client_fuzzer.cpp
index bc4fb259..8480223c 100644
--- a/tests/fuzz/ssh_client_fuzzer.cpp
+++ b/tests/fuzz/ssh_client_fuzzer.cpp
@@ -32,6 +32,7 @@ static int auth_callback(const char *prompt,
{
(void)prompt; /* unused */
(void)echo; /* unused */
+ (void)verify; /* unused */
(void)userdata; /* unused */
snprintf(buf, len, "secret");
@@ -86,7 +87,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
ssh_session session = NULL;
ssh_channel channel = NULL;
- char *banner = NULL;
const char *env = NULL;
int socket_fds[2] = {-1, -1};
ssize_t nwritten;
@@ -98,7 +98,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
assert(rc == 0);
nwritten = send(socket_fds[1], data, size, 0);
- assert(nwritten == size);
+ assert((size_t)nwritten == size);
rc = shutdown(socket_fds[1], SHUT_WR);
assert(rc == 0);
diff --git a/tests/fuzz/ssh_server_fuzzer.cpp b/tests/fuzz/ssh_server_fuzzer.cpp
index b96d46bc..26498df6 100644
--- a/tests/fuzz/ssh_server_fuzzer.cpp
+++ b/tests/fuzz/ssh_server_fuzzer.cpp
@@ -73,6 +73,7 @@ static int auth_none(ssh_session session, const char *user, void *userdata)
(struct session_data_struct *)userdata;
(void)session;
+ (void)user;
if (sdata->auth_attempts > 0) {
sdata->authenticated = true;
@@ -146,7 +147,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
assert(rc == 0);
nwritten = send(socket_fds[1], data, size, 0);
- assert(nwritten == size);
+ assert((size_t)nwritten == size);
rc = shutdown(socket_fds[1], SHUT_WR);
assert(rc == 0);