Subject: Re: libssh2 master 30e2881 sftp_read: use a state variable to avoid bad writes

Re: libssh2 master 30e2881 sftp_read: use a state variable to avoid bad writes

From: liuzl <xieepp_at_gmail.com>
Date: Mon, 19 Sep 2011 09:52:57 +0800

2011/9/17 Daniel Stenberg <daniel_at_haxx.se>

There is a little problem:
- if(sftp->read_state == libssh2_NB_state_sent)
+ if(sftp->read_state == libssh2_NB_state_sent &&
+ _libssh2_list_first(&handle->packet_list) != NULL) {
+ /* If we previously set the read_state to libssh2_NB_state_sent
+ due to EAGAIN, but the caller canceled subsequent request(by close
+ handle or seek), then we will get a NULL loop in the next call,
+ give a judgement here to avoid this. */
         goto send_read_requests;
+ }

See attachment.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2011-09-19