diff --git a/src/sftp.c b/src/sftp.c index c406d41e..eb4d6614 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -603,7 +603,7 @@ const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx) return NULL; } - if (idx > sftp->ext->count) { + if (idx >= sftp->ext->count) { ssh_set_error_invalid(sftp->session); return NULL; } @@ -622,7 +622,7 @@ const char *sftp_extensions_get_data(sftp_session sftp, unsigned int idx) return NULL; } - if (idx > sftp->ext->count) { + if (idx >= sftp->ext->count) { ssh_set_error_invalid(sftp->session); return NULL; }