diff options
| -rw-r--r-- | src/AFC.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -742,7 +742,7 @@ afc_file_read(afc_client_t client, uint64_t handle, char *data, int length, uint | |||
| 742 | const int MAXIMUM_READ_SIZE = 1 << 16; | 742 | const int MAXIMUM_READ_SIZE = 1 << 16; |
| 743 | afc_error_t ret = AFC_E_SUCCESS; | 743 | afc_error_t ret = AFC_E_SUCCESS; |
| 744 | 744 | ||
| 745 | if (!client || !client->afc_packet || !client->connection || handle == 0) | 745 | if (!client || !client->afc_packet || !client->connection || handle == 0 || (length < 0)) |
| 746 | return AFC_E_INVALID_ARGUMENT; | 746 | return AFC_E_INVALID_ARGUMENT; |
| 747 | log_debug_msg("%s: called for length %i\n", __func__, length); | 747 | log_debug_msg("%s: called for length %i\n", __func__, length); |
| 748 | 748 | ||
