mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
sftp: Fix out-of-bound read from sftp extensions
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
This commit is contained in:
@@ -603,7 +603,7 @@ const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx > sftp->ext->count) {
|
if (idx >= sftp->ext->count) {
|
||||||
ssh_set_error_invalid(sftp->session);
|
ssh_set_error_invalid(sftp->session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -622,7 +622,7 @@ const char *sftp_extensions_get_data(sftp_session sftp, unsigned int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx > sftp->ext->count) {
|
if (idx >= sftp->ext->count) {
|
||||||
ssh_set_error_invalid(sftp->session);
|
ssh_set_error_invalid(sftp->session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user