mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
buffer_get_data returns 0 on error, so checking buffer_get_u* for < 0 makes no sense
Signed-off-by: Andreas Schneider <mail@cynapses.org>
This commit is contained in:
committed by
Andreas Schneider
parent
110d201e02
commit
ef8246a592
@@ -452,7 +452,7 @@ ssh_string agent_sign_data(struct ssh_session_struct *session,
|
||||
buffer_free(request);
|
||||
|
||||
/* check if reply is valid */
|
||||
if (buffer_get_u8(reply, (uint8_t *) &type) < 0) {
|
||||
if (buffer_get_u8(reply, (uint8_t *) &type) != sizeof(uint8_t)) {
|
||||
goto error;
|
||||
}
|
||||
if (agent_failed(type)) {
|
||||
|
||||
@@ -303,7 +303,7 @@ sftp_packet sftp_packet_read(sftp_session sftp) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (buffer_get_u32(packet->payload, &size) < 0) {
|
||||
if (buffer_get_u32(packet->payload, &size) != sizeof(uint32_t)) {
|
||||
buffer_free(packet->payload);
|
||||
SAFE_FREE(packet);
|
||||
sftp_leave_function();
|
||||
|
||||
Reference in New Issue
Block a user