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:
Bernhard R. Link
2009-10-23 22:20:16 +02:00
committed by Andreas Schneider
parent 110d201e02
commit ef8246a592
2 changed files with 2 additions and 2 deletions

View File

@@ -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)) {

View File

@@ -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();