summaryrefslogtreecommitdiffstats
path: root/src/AFC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/AFC.c')
-rw-r--r--src/AFC.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/AFC.c b/src/AFC.c
index 54b3795..c97141c 100644
--- a/src/AFC.c
+++ b/src/AFC.c
@@ -819,7 +819,7 @@ afc_file_write(afc_client_t client, uint64_t handle,
char *out_buffer = NULL;
afc_error_t ret = AFC_E_SUCCESS;
- if (!client || !client->afc_packet || !client->connection || !bytes || (handle == 0))
+ if (!client || !client->afc_packet || !client->connection || !bytes || (handle == 0) || (length < 0))
return AFC_E_INVALID_ARGUMENT;
afc_lock(client);