mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
Fix "-m none" case where an entire packet fits in a block and can be
read by read_packet_init()
This commit is contained in:
parent
d37dcc636f
commit
34f9b2a8f7
7
packet.c
7
packet.c
@ -133,6 +133,12 @@ void read_packet() {
|
||||
/* Attempt to read the remainder of the packet, note that there
|
||||
* mightn't be any available (EAGAIN) */
|
||||
maxlen = ses.readbuf->len - ses.readbuf->pos;
|
||||
if (maxlen == 0) {
|
||||
/* Occurs when the packet is only a single block long and has all
|
||||
* been read in read_packet_init(). Usually means that MAC is disabled
|
||||
*/
|
||||
len = 0;
|
||||
} else {
|
||||
len = read(ses.sock_in, buf_getptr(ses.readbuf, maxlen), maxlen);
|
||||
|
||||
if (len == 0) {
|
||||
@ -149,6 +155,7 @@ void read_packet() {
|
||||
}
|
||||
|
||||
buf_incrpos(ses.readbuf, len);
|
||||
}
|
||||
|
||||
if ((unsigned int)len == maxlen) {
|
||||
/* The whole packet has been read */
|
||||
|
Loading…
Reference in New Issue
Block a user